if statement nesting

jtoms

New Member
Joined
Oct 26, 2004
Messages
29
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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
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
Joined
Oct 26, 2004
Messages
29
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
Joined
Jan 20, 2004
Messages
3,460
Sounds like you need a lookup:

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

tactps

Well-known Member
Joined
Jan 20, 2004
Messages
3,460
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))
 

Forum statistics

Threads
1,148,269
Messages
5,745,776
Members
423,971
Latest member
Jogesh

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top