View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 594
Default I am having trouble with the IF function and a compound condition

That would require VBA, not "just a formula copied down"..........
If you would rather have a code solution instead of a formula one, post back
and someone will help.

Vaya con Dios,
Chuck, CABGx3


"rub" wrote in message
ups.com...
I am putting this function in every cell in one column so that if that
row contains 369 and "Gas" then 54 should be the result or else what is
already in the cell.

Address Utility Units
369 Gas 54
1710 Elec 36

The 36 would have already been in the cell. The 54 was added by the
formula


CLR wrote:
It depends on what "some cells" is, how many there are, and what values

you
wish displayed.........in other words, we need more details........

Vaya con Dios,
Chuck, CABGx3




"rub" wrote in message
ups.com...
I have a different twist on the same question. For some cells I need
to leave the current value in the cell alone if the IF premise if
false. So in other words instead of the value being 18, I would like
to not change the value of the cell. Any ideas?


rub wrote:
I want to use the IF function to set a value of 54 if A100=369 and
B100="Gas" or A100=391 and B100="Gas". Otherwise the value should

be
18.

I used =IF((A100=369 and B100="Gas") or (A100=391 and
B100="Gas"),54,18) and got an error.

I also used =IF(B100="Gas" and (A100=369 or A100=391), 54,18) and

also
got an error.

Any ideas?