Aika Baker
Aika Baker

Reputation: 1

I can't find the error in my formula that's causing the #VALUE

My formula is

=IF(OR(ISBLANK(F2),ISBLANK(D2)),"MISSING",F2-D2)

D2 and F2 are both dates, F2 only has a date if something has been entered for that invoice so not all cells in column F have a date. So if the cell in column F is blank, I want the formula to put "MISSING" in the cell of the formula but I'm getting

#VALUE!

Where am I going wrong with this formula?

Upvotes: 0

Views: 72

Answers (1)

teylyn
teylyn

Reputation: 35915

Your formula will attempt the subtraction even if the values in the cells are text.

If you want to calculate only when both cells have dates, then use IsNumber() instead of IsBlank(), but you need to change OR() to AND() and reverse the true/false actions.

=IF(AND(ISNUMBER(F6),ISNUMBER(D6)),F6-D6,"Missing")

enter image description here

Upvotes: 2

Related Questions