multiple if statment

G

Guest

How can I make an IF formula return a specific value when a specific cell has
an "x" in it.

Specifically,

- I have 5 columns set to have user enter an "x" in. Columns N, O, P, Q,
and R.
- I have 1 column on the end to insert formula in. This is column W.

If user puts an "x" in cell N3 then W3 will return a 1.
If user puts an "x" in cell O3 then W3 will return a 2.
If user puts an "x" in cell P3 then W3 will return a 3 and so on.

Right now I have this formula which returns a #VALUE error.

=IF(N3="x","1",""),IF(O3="x","2",""),IF(P3="x","3",""),IF(Q3="x","4",""),IF(R3="x","5","")

Thank you very much,
 
M

MyVeryOwnSelf

How can I make an IF formula return a specific value when a specific
cell has an "x" in it.

Specifically,

- I have 5 columns set to have user enter an "x" in. Columns N, O,
P, Q,
and R.
- I have 1 column on the end to insert formula in. This is column W.

If user puts an "x" in cell N3 then W3 will return a 1.
If user puts an "x" in cell O3 then W3 will return a 2.
If user puts an "x" in cell P3 then W3 will return a 3 and so on.

Using IF, one way is:
=IF(N3="x",1,IF(O3="x",2,IF(P3="x",3,IF(Q3="x",4,IF(R3="x",5,"")))))

But I'd take a different approach, something more like:
=IF(ISNA(MATCH("x",N3:R3,0)),"",MATCH("x",N3:R3,0))
 

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