[Solved] IF statement problem

Lee

New member
1758889428148.png

The available space D1 is floor space.
If there is no measurable ventilation data the D5 or D6 or D7 and they say 0 then divide D1 by C8 (50%) answer into D10
If there is ventilation type and D5>0 or D6>0 or D7>0 then the lowest number answer in D10
I hope that makes sense, happy to clarify if required. Thanks in advance.
Lee
 
Hello Lee,

Here’s a one-cell solution for D10 that follows your rules:

Rule logic:
  • If no measurable ventilation (D5:D7 all = 0) ⇒ use reduction: D1 × C8.
  • If any ventilation value is given ⇒ use the lowest positive among D5:D7.
Formula (modern Excel / 365) – enter in D10:

=IF(COUNTIF(D5:D7,">0")=0,
D1*C8,
MIN(IF(D5:D7>0,D5:D7))
)

  • (Spills naturally; if you’re on an older Excel, confirm with Ctrl+Shift+Enter.)
Non-array alternative (works in all versions):

=IF(COUNTIF(D5:D7,">0")=0,
D1*C8,
AGGREGATE(15,6,D5:D7/(D5:D7>0),1)
)

Notes:

  • Put 50% (i.e., 0.5 formatted as %)** in C8.
  • Example with your numbers: D1=50, C8=50%, D5=10, D6=0, D7=0 → result is 10.
  • If D5=D6=D7=0 → result is 25 (50 × 50%).
If you want blanks instead of 0 when D1 is empty, wrap the whole thing in IF(D1="","", … ).
 
=IF(COUNTIF(D25:D27,">0")=0,C28*C8,AGGREGATE(15,6,D25:D27/(D25:D27>0),1)
Hi,
Thanks for the response. I have entered the formula as you sent above. The trouble is D25:D27 can be any number and they need to be totalled into D30, if D25:D27 are "0" only then do we divide D23 by 50% which is C28. I hope that makes sense. It also needs to total D25:D27 into the D30 cell.
1759134350305.png
 

Attachments

  • 1759134049543.png
    1759134049543.png
    23.9 KB · Views: 1
Last edited:
Hello Lee,

Thanks, that makes sense. If D25:D27 should be added up (any numbers), and only when all three are 0 you want to use 50% of the Theoretical Capacity (D23 × C28), then put this in D30:

=IF(SUM(D25:D27)=0, D23*C28, SUM(D25:D27))
  • SUM(D25:D27)=0 → no measurable ventilation ⇒ return D23 * C28 (your 50% case).
  • Otherwise ⇒ return the total of D25:D27.
If you want to ignore any negative or text values and only add positive entries:

=IF(SUM(D25:D27)=0, D23*C28, SUMIFS(D25:D27, D25:D27, ">0"))

That should give you the behavior you described and keep D30 as the final ventilation capacity.
 
  • Like
Reactions: Lee
You are most welcome. Glad to hear that! Happy you’re finding value in the group. Keep learning and exploring with ExcelDemy!
 

Online statistics

Members online
2
Guests online
224
Total visitors
226

Forum statistics

Threads
442
Messages
1,948
Members
1,313
Latest member
pinupazz
Back
Top