If and formula with dates

CookieMonster76

Board Regular
Joined
Apr 30, 2015
Messages
195
Hi
I have the following

=IF(AND(SUM(H64:H65)>20000,H7<I7),0,A3)

where H7 and I7 are dates, and H7 is earlier then I7

Whichever way around I put the "<" or ">", the formula never returns zero, always returns the value in cell A3.

If i put = H7<I7 into a different cell it returns FALSE for one way round and "TRUE" for the other.

How do i make it so it does the calculation and takes into account the dates?

Thanks

Paul
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The forum software has broken your formula, you will need to insert spaces before and after the < and > symbols to prevent it from happening.
 
Upvote 0
Thanks

The formula I am trying to make work is:

=IF(AND(SUM(I64:I65)>20000,H7 > I7),0,-A3)

Where I7 and h7 are dates, with I7 being the earliest

If i put H7 > I7 in a separate cell it returns true or false depending which way around it is.

I basically need it to return the value in A3 if H7 is a later date than I7.

Thanks

Paul
 
Upvote 0
How does SUM() > 20000 fit into it?

Because you're using AND() both criteria must be true to return 0, so if the sum is < 20000 then the result will always be false regardless of the dates.

Maybe you need OR or XOR instead of AND?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,414
Members
448,895
Latest member
omarahmed1

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