Avatar of route217
route217
Flag for United Kingdom of Great Britain and Northern Ireland asked on

add additional step to current if formula

Hi Experts excel 2007

I meed to amend the current if formula to include the following step..

Formula
=if (f2="ms comm","ccs", if (f2 <>"ms comm", j2,"")) works fine

So if j2 =2 then rrr if j2 =1 then sss otherwise ""
Microsoft Excel

Avatar of undefined
Last Comment
Rob Henson

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rob Henson

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
route217

ASKER
Hi Rob H

Sorry should have included if j2 =0 then blank. ..

Just getting used to the mew site...
Rob Henson

=IF(F2="ms comm","ccs",IF(J2=0,"",IF(J2=1,"sss","rrr")))

If you start to have more values for J2, it might be worth setting up a small lookup table to return the relevant value for J2, eg:

0     {blank}
1    sss
2    rrr

This won't work if you truly want the result for J2 being zero to be blank. Leaving the cell blank will return a zero when looking up the zero. To get over that enter a space or just an apostrophe. However, if you have subsequent formulas that rely on the result of this being blank will have to be adapted to allow for the space or apostrophe.

Thanks
Rob H
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes