IF(AND) returning FALSE value when it should be true

Callaghan86

New Member
Joined
Feb 14, 2017
Messages
15
Can someone help me with this formula please?

Essentially "Overview!B*" is the period, and "Overview!D*" is the date.

I know for a fact that the return value for the IF(AND) is TRUE, but when I evaluate it, it's saying it's FALSE.

=IF(AND(Overview!$D$11:$D$193=TODAY(),Overview!$B$11:$B$193=B10),SUMIFS(Overview!$K$11:$K$193,Overview!$B$11:$B$193,B10,Overview!$D$11:$D$193,"<"&TODAY()),SUMIFS(Overview!$K$11:$K$193,Overview!$B$11:$B$193,B10))

The first step of the evaluation is:

IF(AND(42662=42810). These 2 numbers obviously don't match.

The D column is a list of dates for an entire year. Why is it not finding today's value?

The SUMIFS can be disregarded, as I know these will work. It's the first step of the evaluation that is the problem.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I guess D11 contains 19/10/2016. You can't check all values without using an array formula. It's not clear what you're trying to achieve.

WBD
 
Upvote 0
Basically our year is broken down into 13 periods. I want to say "If today falls within the period (B10), do one thing. If it doesn't, do another thing.

Why isn't it looking to find today's date matching with the period in B10? It normally works this way.
 
Upvote 0
Still not 100% clear but perhaps try this:

Code:
=IF(SUMPRODUCT((Overview!$D$11:$D$193=TODAY())*(Overview!$B$11:$B$193=B10))>0,SUMIFS(Overview!$K$11:$K$193,Overview!$B$11:$B$193,B10,   Overview!$D$11:$D$193,"<"&TODAY()),SUMIFS(Overview!$K$11:$K$193,Overview!$B$11:$B$193,B10))

WBD
 
Last edited:
Upvote 0
I've fixed the problem using the following:

=IF(AND(VLOOKUP(TODAY(),Overview!$D$5:$D$187,1,2),(VLOOKUP(B10,Overview!$B$5:$B$187,1,2))),SUMIFS(Overview!$K$5:$K$187,Overview!$B$5:$B$187,B10,Overview!$D$5:$D$187,"<"&TODAY()),SUMIFS(Overview!$K$5:$K$187,Overview!$B$5:$B$187,B10))

Thanks
 
Upvote 0
OK but I'm not 100% sure that your solution is correct because there's no guarantee that the two vlookups return data from the same row. I'll leave it with you.

WBD
 
Upvote 0
It seems to work for now! Just out of interest, what could I use instead of 2 separate VLOOKUPS? Sorry, I'm relatively new to Excel.
 
Upvote 0
just out of interest, would CONCATENATE be a simple solution? Concatenate the dates and period then search for the one value.
 
Upvote 0

Forum statistics

Threads
1,216,499
Messages
6,131,010
Members
449,613
Latest member
MedDash99

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