# If function formula

1. ## If function formula

Hello - I tried the formula that if A is greater than 3 days, then it shows 1 and if not, then it come 0.
It come VALUE! error.

Attached file  Register To Reply

2. ## Re: If function formula

You are comparing a TEXT string with TODAY() which is simply a number in Excel (45004 for today) so I am not sure what you are attempting to do..  Register To Reply

3. ## Re: If function formula

Thank you for the giving answer.
Actually i want to apply condition with the help of IF function in Text.
The condition is if A is greater than 3 days, then it should show 1 and if not, then it should show 0.  Register To Reply

4. ## Re: If function formula

You date to compare a DATE in A otherwise all you can compare is the DAY(S) value > 3: so in A1 are you comparing 58 > 3 ??  Register To Reply

5. ## Re: If function formula

who controls what is in column A?
if you do, this would be one way to accomplish that.
for all cells in col A make sure they are filled in the same way, so A2 and A3 both start with days but A4 and A5 do not.
So change those to 0 day(s), 0 hour(s) etc.
then this formula will work...
=IF(TODAY()-3>TODAY()-(--LEFT(A2,SEARCH(" day(s)",A2)-1)*24+(--MID(A2,SEARCH(" hour(s)",A2)-2,2))+(--MID(A2,SEARCH(" minute(s)",A2)-2,2)/60))/24,1,0)
see attached  Register To Reply

6. ## Re: If function formula

Actually i practice how we can i change and extract any format to number format.
I have learned a lot from this formula.

Thank you so much JohnTopley and Sam Capricci. It is very helpful.  Register To Reply