Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Calculate number of days between two dates, depending onif cell is blank or not. I have a worksheet used for tracking inventory. There is acolumn

Calculate number of days between two dates, depending onif cell is blank or not.

I have a worksheet used for tracking inventory. There is acolumn for "Date Received", "Date Sold", and "Days in Inventory".I've been entering the "Days in Inventory" manually for a while,and want to make it formula driven to lessen the reportmaintenance.

I would like the formula for "Days in Inventory" to return thenumber of days that have passed between the "Date Received" and the"Date Sold". I am currently using the below formula.

=(L5-DATE(YEAR(L5),MONTH(L5)-IF(DAY(L5)

This causes two problems:

1) When nothing is entered in the "Date Sold" cell the formulareturns "#NUM!"

2) When nothing is entered in both the "Date Received" and "DateSold" cells the formula returns "0"

I want the formula to adapt depending on if none, one, or boththe date cells have an entry.

- For no dates entered (blank cells), I would like it to returntext of my choice. Let's say "Not Received".

- For a "Date Received" entered, and a blank cell for "DateSold", I would like it to return the number of days between "Today"and the "Date Received". This would continue to count up the daysan item was in inventory until sold.

- For both dates entered, I would like it to return the numberof days between the "Date Received" and "Date Sold", which itcurrently does using the above formula.

Can anyone provide a formula update that will fix the aboveissues? I am not an Excel expert and this formula is a bit out ofmy leauge, so any help is greatly appreciated.

Please advise if any further information is required.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

1. What is the definition of quality?

Answered: 1 week ago

Question

3. Name and describe the eight dimensions to quality.

Answered: 1 week ago