Counting days comparing 2 dates excluding empty cells

T

Terry Rogers

I've entered the formula =(L25-M3) in a target cell to count the length of
stay of patients on a hospital unit. L 25 contains the formula to enter the
current date,that is =today(). Each cell in column "M" is the hand entered
admission date. This formula works but I need it to ONLY do the calculation
if there is a value entered in column "M." What argument do I add to
suppress the calculation if "M" is blank? Currently it displays a bizzar
number.
 
T

Terry Rogers

Slick. Thanks
And somewhere in the back of my mind I know the number was "Bizarre" not
"Bizzar."
 
T

Terry Rogers

Thought the next step would be easy. I now need to subtract 1 from the sum
of the above calculation. These variants produce the correct answer, but
result in an error entry in the target cell again if there is no value in "M"
.. =IF(N4="","",TODAY()-1-N4) ....... =(IF(N4="","",TODAY()-N4)-1)
 
P

PCLIVE

I thought we covered that with the IF(M3="",""...portion of the formula.
However, if there is some other value including spaces, then the result
would probably be #VALUE!.

You might try this out.

=IF(ISNUMBER(N4),TODAY()-N4-1,"")

Note: I used the "N" column reference since that is what was in your
example.

Does that help?
Paul

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top