AND Statement to Return TRUE or FALSE

jski21

Board Regular
Joined
Jan 2, 2019
Messages
155
Office Version
  1. 2016
Platform
  1. Windows
Good day all,

Attempting to have a formula look at a date AND if a number falls between a certain range. If the date is prior to today AND the number falls between a range the result is TRUE. If not, it is FALSE. Here's the formula that I'm fighting with:

=AND(E28<$A$4,(D32>=(E26*0.5),D32<E26)

E28 = 12/31/2015
$A$4 = Today()
D32 = 19.4%
E26 = 25%

Basically, if the date is prior to today AND the value falls between 12.5% and 25% the statement is true. If not, false. The result of this statement will eventually be used to highlight Cell E32 with an amber color via conditional formatting. I'm likely missing/misplacing a comma or parentheses somewhere but have tried numerous iterations in what I believe to be correct. I'm not. :(


Cell Formulas
RangeFormula
E26E26=Pivot!K6
D28:D32D28=INDEX(Pivot!I:I,MATCH(1,(Data!$E$9=Pivot!A:A)*(Dashboard!A28=Pivot!B:B),0))
E28:E32E28=INDEX(Pivot!$K$7:$O$39,MATCH(Data!$E$9&A28,Pivot!$A$7:$A$39&Pivot!$B$7:$B$39,0),MATCH($E$26,Pivot!$K$6:$O$6,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E32Expression=AND(E32<$A$4,D32>=$E$26)textNO
E28Expression=AND(E28<$A$4,D28>=$E$26)textNO



Manny thanks in advance everyone.


jski
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You have an extra left parenthesis in there.
Try:
Excel Formula:
=AND(E28<$A$4,D32>=(E26*0.5),D32<E26)
or a little more simply:
Excel Formula:
=AND(E28<$A$4,D32>=(E26/2),D32<E26)
 
Upvote 0
Solution
That's it. It's amazing what a second set of experienced eyes can do Joe4. Thanks!
 
Upvote 0
You are welcome.

A little trick that you can do is to try each condition as its own formula, and see which one errors out, i.e.
=E28<$A$4
=(D32>=(E26*0.5)
=D32<E26


You will see that the second one errors out, and when you look at it in isolation like that, it is easier to spot the issue.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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