# if statement nesting

#### jtoms

##### New Member
I have too many if statements nested--how can i get around this problem to include all the cells i want.

Thank you.

Jason

### Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

#### tactps

##### Well-known Member
You need to review your formula to determine a better way, using AND, OR, SUMPRODUCT or something else.

Post some detail and we'll take a look.

#### jtoms

##### New Member
Okay. Thank you.

here is my code as it stands:

=IF(A4='Source Data'!\$A\$4,'Source Data'!\$B\$4,IF(A4='Source Data'!\$A\$5,'Source Data'!\$B\$5,IF(A4='Source Data'!\$A\$6,'Source Data'!\$B\$6,IF(A4='Source Data'!\$A\$7,'Source Data'!\$B\$7,IF(A4='Source Data'!\$A\$8,'Source Data'!\$B\$8,IF(A4='Source Data'!\$A\$9,'Source Data'!\$B\$9,IF(A4='Source Data'!\$A\$10,'Source Data'!\$B\$10,IF(A4='Source Data'!\$A\$11,'Source Data'!\$B\$11,"Not Recognized"))))))))

Are you saying that if i used a bunch of IF statements connected by AND then I could use as many IFs as I want?

Jason

#### tactps

##### Well-known Member
Sounds like you need a lookup:

=vlookup(a4,'Source Data'!A:B,2,false)

#### tactps

##### Well-known Member
Or to be more specific:
=if(isna(vlookup(a4,'Source Data'!A4:B10,2,false)
),"Not recognised",vlookup(a4,'Source Data'!A4:B10,2,false))

#### jtoms

##### New Member
Thank you so much. It works like a charm!

Jason

Replies
6
Views
436
Replies
3
Views
965
Replies
1
Views
292
Replies
6
Views
305
Replies
1
Views
250

1,182,024
Messages
5,933,327
Members
436,888
Latest member
Kantonides

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back