Wild Card

Peter Muller

Board Regular
Joined
Oct 15, 2018
Messages
133
Office Version
  1. 365
Platform
  1. Windows
Good afternoon Experts,



I am battling to use the wild card in this “if” and “vlookup” formula.



I have in excess of a 2000 entries and 8 sheets.



Please help.



RefNameDesignation
MAN1=IF(C2="Alb 1",VLOOKUP(A2,Albany!A:B,2,FALSE), IF(C2="Cap 1", VLOOKUP(A2,Cape!A:B,2,FALSE)))Alb 1-Gr C
MAN2Alb 1-Gr D
MAN3There are 8 nested "if" statements - 8 different sheetsAlb 1-Gr E
MAN4How to use the wild card with "Alb 1" , "Cap 1" , etc.Cap 1-Gr C
MAN5Cap 1-Gr D
MAN6Cap 1-Gr E
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
You could do it with INDIRECT and a second table, or perhaps with something like

=VLOOKUP(A2,CHOOSE(MATCH(LEFT(C2,3),{"Alb","Cap"},0),Albany!A:B,Cape!A:B),2,0)
 
Upvote 0
You could do it with INDIRECT and a second table, or perhaps with something like

=VLOOKUP(A2,CHOOSE(MATCH(LEFT(C2,3),{"Alb","Cap"},0),Albany!A:B,Cape!A:B),2,0)

Thank you,

Will get back to my spreadsheet in an hour, will check and let you know. How will the second table and indirect wok? is there a way around the 8 nested if functions? vba is great if possible
 
Upvote 0
8 nested ifs only applies if you're still using excel 2003 (or older), with newer versions it is much higher, although there is a kind of unwritten theory that if you need more than 3 or 4 ifs then you're doing it wrong ?

With the second table and indirect, you would list 'Alb', 'Cap', etc in the left column and 'Alberta', 'Cape', etc in the second column (the second column should list the names of the sheets).

Then the formula would be

=VLOOKUP(A2,INDIRECT("'"&VLOOKUP(LEFT(C2,3),$D$2:$E$10,2,0)&"'!A:B"),2,0)

Where $D$2:$E$10 refers to the second table.
 
Upvote 0
Thank you,

Will get back to my spreadsheet in an hour, will check and let you know. How will the second table and indirect wok? is there a way around the 8 nested if functions? vba is great if possible

Thank you very much Jason, this one solves my problem ?
 
Upvote 0
8 nested ifs only applies if you're still using excel 2003 (or older), with newer versions it is much higher, although there is a kind of unwritten theory that if you need more than 3 or 4 ifs then you're doing it wrong ?

With the second table and indirect, you would list 'Alb', 'Cap', etc in the left column and 'Alberta', 'Cape', etc in the second column (the second column should list the names of the sheets).

Then the formula would be

=VLOOKUP(A2,INDIRECT("'"&VLOOKUP(LEFT(C2,3),$D$2:$E$10,2,0)&"'!A:B"),2,0)

Where $D$2:$E$10 refers to the second table.

And this one is even better, so thank you very much (y) :)
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,400
Members
448,893
Latest member
AtariBaby

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
Back
Top