Abhishek S Khetan
Abhishek S Khetan

Reputation: 21

How do I understand this expression in an Excel IF statement?

I have downloaded an excel sheet with some formulas for computing time dependent variables. The sheet works perfectly fine, by the way, and does its job. I am trying to deduce the mathematics of the whole model by understanding the formulas in it. One of the formulas reads as the following:

=IF((($B$18>$B$19)*($B$8>=$B$19))+(($B$18<$B$19)*($B$8<=$B$19)),AG30+((F30*$K$22)/($B$13)),$H$230)

On searching a bit on the internet, I find that usually in excel IF statements are written in the following format:

=IF (logical_test, [value_if_true], [value_if_false])

That would imply that the logical test in this case is:

(($B$18>$B$19)*($B$8>=$B$19))+(($B$18<$B$19)*($B$8<=$B$19))

This expression has four instances where >, >=, <, <= are being used and they're connected by + and * arithmetic operators. I am confused about what kind of logical statement this is. Do the * and + symbols stand for operators like AND and OR, respectively, or do they stand for something else?

Any help and/or pointers are appreciated :)

Upvotes: 0

Views: 300

Answers (2)

user13089821
user13089821

Reputation: 11

Someone used mathematical operators instead of logical ones, here is what that formula says:

"If either B18 is greater than B19 or B8 is greater than or equal to B19 and either B18 is less than B19, or B8 is greater than or equal to B19, then" ...(value if true),(value if false)

An easier formula to grasp IMO is this one:

=IF(OR(AND(B18>B19,B8>=B19),AND(B18<B19,B8<=B19)),AG30+((F30*$K$22)/($B$13)),$H$230)

Upvotes: 1

ManhND
ManhND

Reputation: 77

In Formula Tab, excel have Formula validation With this function you can simulation step by step your cell formula. Let try it!

Upvotes: 0

Related Questions