7+ nested if statement?

G

Guest

I currently have created an if statement with 7 nested if statements. I now
need to add another if statement, but there is a limit of 7 nested
statements. Is there a work around.

My issue is that I want to copy the # in cell B1 to cell C1 only if cell A1
matches one of the 8 values in column D (D1:D8), if not return a value of 0.

The if statement worked for 7 values, but now I have 8. Please help
Thanks!
 
N

Nitin Harkawat

More than one ways of doing it , Use countif or vlookup or sumif etc
Here is one way
On cell C1 type
=IF(OR(A1=d1:d8)=TRUE,A1,0)
array entered (Ctrl+shift+enter)
 
D

Dave R.

In C1, try something like;

=--(COUNTIF($D$1:$D$8,A1)>0)*B1

or
=IF(COUNTIF($D$1:$D$8,A1)>0,B1,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