Only perform an if statement if the contains a date and ignore other data

Engineerlee

New Member
Joined
Nov 30, 2012
Messages
26
Hi,

I have a cell A1
this contains a formula to pull a date from another worksheet using an Index and Match Formula

In Cell A2 I want to perform a check to see if that date is greater than or less than today.
The problem I have is that my formula in Cell A2 is seeing the formula in A1 and always returns a value even if no date is displayed.

This is my formula in A2
<today(),"overdue","not due")<today(),"overdue","not="" due")
<today(),"overdue","not due")
<today(),"overdue","not due")="" "
IF(K25<TODAY(),"OVERDUE","NOT DUE")<today(),"overdue","not due")
<today(),"overdue","not due")


Any advice.</today(),"overdue","not></today(),"overdue","not></today(),"overdue","not></today(),"overdue","not></today(),"overdue","not>
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
FYI, sometimes a < symbol can be interpreted as an HTML tag, which is why your formula got cut off. The easiest way to avoid that is to put a space after each one, like this:

=IF(K25< TODAY(),"OVERDUE","NOT DUE")

You can probably change your formula to something like this:

=IF(K25="","",IF(K25< TODAY(),"OVERDUE","NOT DUE"))
 
Upvote 0
Not sure why but the formula I have placed in the thread isnt fully visible
Below is what should be displayed

=IF(A2<TODAY(),"OVERDUE","NOT DUE")
 
Upvote 0
The formula in A2 should be
=IF(A1< TODAY(),"overdue","not due")
When posting a formula that contains either < or > make sure there is a space either side of them. Otherwise the board's software treats them HTML code.
 
Upvote 0
What formula do you have in A1, or is it A2? I'm a bit unclear as to which cell you want to check.
 
Last edited:
Upvote 0
Hi Eric
Apologies.

A1 contains a formula to Pull a date from another sheet
I want to check A1 to see if the date is greater than or less than Today, using a formula (below) in A2
However I always return "Overdue" in A2

=IF(A1 < TODAY(),"OVERDUE","NOT DUE"))

Hope that helps
 
Last edited:
Upvote 0
Have you tried the formula I suggested in post 2?

=IF(A1="","",IF(A1 < TODAY(),"OVERDUE","NOT DUE"))

If it does not work, what is the formula in A1? You said there's an INDEX formula there to get the date from another sheet. If the date is unobtainable for some reason, we need to see what that formula returns instead of the date, and check for that in the A2 formula.
 
Upvote 0
Hi Eric,

Here is the Index and Match from A1

=IFERROR(INDEX('1.1 Centre '!$Q:$Q,MATCH(Schedule!F25,'1.1 Centre '!$D:$D,0),1),"")

Not sure if this also adds to the problem, but to prevent a default date of 00/01/1900 being returned if the index match returns nothing I have a custom Format for A1 cell of dd/mm/yyyy;;

cheers
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top