View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default =IF(AND... function

IF K47="abc" && (B3=I49), (H49-B3)*J49*1000, " " OR
IF K47="abc" && (B3<=I49), (H49-I49)*J49*1000, " "


Ok, but you have a logic conflict:

If B3 does = I49 what should the result be? According to the above it should
be both:

(H49-B3)*J49*1000
(H49-I49)*J49*1000

I'll assume the logic should be =I49 for (H49-B3)*J49*1000
and <I49 for(H49-I49)*J49*1000

=IF(K47="abc",IF(B3=I49,(H49-B3)*J49*1000,(H49-I49)*J49*1000),"")

That doesn't account for empty cells!


--
Biff
Microsoft Excel MVP


"Mukesh" wrote in message
...
=IF(AND(K47="abc", B3=I49), (H49-B3)*J49*1000,""),
I do get a blank cell, but it doesn't calculate if B3<=I49.

I am not able to put code right.
IF K47="abc" && (B3=I49), (H49-B3)*J49*1000, " " OR
IF K47="abc" && (B3<=I49), (H49-I49)*J49*1000, " "

Please advise.

Thanks.
Mukesh

"T. Valko" wrote:

I need 2 conditions to meet else it should be an empty sell.
=IF(AND(K47="abc", B3=I49), (H49-B3)*J49*1000, (H49-I49)*J49*1000)
I still get the calculated value, even if cell K47 is blank.


If K47 is blank then AND = FALSE and the IF function evaluates the
value_if_false argument which is:

(H49-I49)*J49*1000

So, if both conditions are not met and you want the cell left blank then:

=IF(AND(K47="abc", B3=I49), (H49-B3)*J49*1000,"")



--
Biff
Microsoft Excel MVP


"Mukesh" wrote in message
...
I need 2 conditions to meet else it should be an empty sell.
My code is
=IF(AND(K47="abc", B3=I49), (H49-B3)*J49*1000, (H49-I49)*J49*1000)

I still get the calculated value, even if cell K47 is blank.

Please help.

Thanks.
Mukesh