Can you do an IF statement on a range?

Blackcloud_9

New Member
Joined
Jun 11, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Can you do an IF statement on a range? See statements below (Please forgive any errors 1st time posting)

If I try:
=IF(E13:E21="","",(IF(AND(D13:D20>=62,D21>=86.02),"PASS","FAIL")))
or
=IF(E13:E21="","",(IF(AND(D13>=62,D14>=62,D15>=62,D16>=62,D17>=62,D18>=62,D19>=62,D20>=62),"PASS","FAIL")

Each one gives me a #Value error

Also on each individual PASS/FAIL cell (See H17 for example) I have “=IF(G17="","",(IF(G17>=31,"PASS","FAIL")))”, so if there isn’t an entry in the Pressure column, the PASS/FAIL cell will remain empty. (This works)

I would like to apply that to D21 and G21. Do I need to create a huge IF-OR-AND statement or is there a more concise way?
1591910310906.png

Automated Data Sheet redacted.xlsx
ABCDEFGH
1
2
3Inner TrayOuter Tray
4
5Test Selected:__________Test Selected:__________
6Flow: Sensitivity:Flow: Sensitivity:
7Prefill: Units:Prefill: Units:
8IDPressurePressure ≥ 62.0IDPressurePressure ≥ 31.0
9(in H2O)(P or F)(P or F)
10BeginningA190PASSA123FAIL
11A2120PASSA244PASS
12B162PASSB115FAIL
13B266PASSB20FAIL
14EndA199PASSA1-6FAIL
15A2105PASSA287PASS
16B1105PASSB12112PASS
17B277PASSB2 
18Mean90.50PASSMean325.00PASS
19Inner Tray:86.02Outer Tray:44.07
20
21Individual and Mean values (Pass/Fail)PASSIndividual and Mean values (Pass/Fail)
Sheet2
Cell Formulas
RangeFormula
E10:E17E10=IF(D10="","",(IF(D10>=62,"PASS","FAIL")))
H10:H17H10=IF(G10="","",(IF(G10>=31,"PASS","FAIL")))
D18,G18D18=AVERAGE(D10:D17)
E18E18=IF(D18="","",(IF(D18>=86.02,"PASS","FAIL")))
H18H18=IF(G18="","",(IF(G18>=44.07,"PASS","FAIL")))
D21D21=IF(AND(D10>=62,D11>=62,D12>=62,D13>=62,D14>=62,D15>=62,D16>=62,D17>=62,D18>=86.02),"PASS","FAIL")
 

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.
The formula needs to be entered as an array using Ctrl, Shift & Enter

also, the 1st one won't work, maybe try

=IF(COUNTA(E13:E21),IF(AND(D13:D20>=62,D21>=86.02),"PASS","FAIL"),"")
 
Upvote 0
Thank you for your reply.
The array works but the "empty cell" part < IF(E13:E21="","", > or < IF(COUNTA(E13:E21), >
Auotmated Worksheet Redacted.jpg
does not.
 
Upvote 0
Try

=IF(COUNTA(E13:E21)<9,"",IF(AND(D13:D20>=62,D21>=86.02),"PASS","FAIL"))

Enter as an array.
 
Upvote 0
The " =IF(COUNTA(E13:E21)<9 " did not work.
But I tried the a COUNTBLANK and that did the trick.
=IF(COUNTBLANK(E13:E21),"",IF(AND(D13:D20>=62,D21>=86.02),"PASS","FAIL")) - as an array

Thank you for the help. The biggest help was the array. Haven't use it for awhile.
 
Upvote 0

Forum statistics

Threads
1,214,893
Messages
6,122,118
Members
449,066
Latest member
Andyg666

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