Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started