## If cell contains certain text then run this formula, otherwise run this formula instead

## If cell contains certain text then run this formula, otherwise run this formula instead

(OP)

Hello

G5 contains a code - could be anything but if there is a K in that code then I want, cell C19 to run a formula: value in G6 divided by 12 multiply by -1 to give a negative figure. But if there's a K in G5 then I want just G6 divided by 12.

What I have at the moment is:

=IF(G5="*K*",G6/12*1,G6/12*-1)

I've had a look round and there is ISERROR, SEARCH etc which will return True and False, but I want a math result. The asterisk for wildcard isn't working for me.

Can you tell me where I've gone wrong?

G5 contains a code - could be anything but if there is a K in that code then I want, cell C19 to run a formula: value in G6 divided by 12 multiply by -1 to give a negative figure. But if there's a K in G5 then I want just G6 divided by 12.

What I have at the moment is:

=IF(G5="*K*",G6/12*1,G6/12*-1)

I've had a look round and there is ISERROR, SEARCH etc which will return True and False, but I want a math result. The asterisk for wildcard isn't working for me.

Can you tell me where I've gone wrong?

thank you for helping

____________

Pendle

## RE: If cell contains certain text then run this formula, otherwise run this formula instead

You

couldaccomplish this with a little of VBA code...---- Andy

There is a great need for a sarcasm font.## RE: If cell contains certain text then run this formula, otherwise run this formula instead

thank you for helping

____________

Pendle

## RE: If cell contains certain text then run this formula, otherwise run this formula instead

=G6/12*IF(FIND(G5,âKâ)>0,1,-1)

Skip,

_{ Just traded in my OLD subtlety... for a NUance!}## RE: If cell contains certain text then run this formula, otherwise run this formula instead

=G6/12*IF(FIND("K", G5)>0,1,-1)

else, (no "K" in G5) the formula returns #VALUE!

---- Andy

There is a great need for a sarcasm font.## RE: If cell contains certain text then run this formula, otherwise run this formula instead

=G6/12*IF(IFERROR(FIND("K", G5),0)>0,1,-1)

Kind of reminds me of...

e

^{(pi * i)}+ 1 = 0Skip,

_{ Just traded in my OLD subtlety... for a NUance!}