Two formulas in one cell?

T

The Stoat

Hi all,

Is it possible to have two formulas in one cell? For example, here's what
I'm trying to do:

If cell A1 has the word HORSE in it, I want the formula in A2 to be x + z
If cell A1 has the word PIG in it, I want the formula in A2 to be x * z

Anyone know if that's possible?

Many thanks,

Matt.
 
P

Peo Sjoblom

If the lower upper case does not matter

=IF(A1="horse",x+z,IF(A1="pig",x*z,""))

if it matters

=IF(--EXACT(A1,"HORSE")=1,x+z,IF(--EXACT(A1,"PIG")=1,x*z,""))

or

=IF(ISNUMBER(FIND("HORSE",A1)),x+z,IF(ISNUMBER(FIND("HORSE",A1)),x*z,""))
 
T

The Stoat

Great, thanks - I'll give that a go!

Matt.

Peo Sjoblom said:
If the lower upper case does not matter

=IF(A1="horse",x+z,IF(A1="pig",x*z,""))

if it matters

=IF(--EXACT(A1,"HORSE")=1,x+z,IF(--EXACT(A1,"PIG")=1,x*z,""))

or

=IF(ISNUMBER(FIND("HORSE",A1)),x+z,IF(ISNUMBER(FIND("HORSE",A1)),x*z,""))

--

Regards,

Peo Sjoblom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top