If Statement involving a Date

Moxioron

Active Member
Joined
Mar 17, 2008
Messages
436
Office Version
  1. 2019
Hello all.

I have looked high and low for an answer on this and i am sure it is right in front of me.

I want to return NA() if the date value in AB2 is less than the date values in A2:A50000. With the formula below I get a #VALUE! result.

Where am I going wrong? Thank you.


=IF(Data!$A$2:$A$50000>DATEVALUE(AB2),NA(),SUMPRODUCT((Data!$A$2:$A$50000>=AB$2)*(Data!$A$2:$A$50000<=AB$3)*(Data!$D$2:$D$50000=$A6),(Data!$E$2:$E$50000)))
 
It worked...kind of.

For some reason it ignores the =. So if Data!A2:A50000 is 08/01/2012 and AB2=08/01/2012 I still get the #N/A. However, if I change the date in A2:A50000 to 08/02/2012, then the sumproduct kicks in.


Weird. Thanks for your help.
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
In that case I think you want to remove that =, i.e.

=IF(MAX(Data!$A$2:$A$50000)< AB$2,NA(),SUMPRODUCT((Data!$A$2:$A$50000>=AB$2)*(Data!$A$2:$A$50000<=AB$3)*(Data!$D$2:$D$50000=$A6),Data!$E$2:$E$50000))
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,749
Members
449,094
Latest member
dsharae57

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