IF Statement for Range of options

BrianP1

New Member
Joined
Jun 4, 2018
Messages
12
Trying to find if this is possible. I have a list of names which I am trying to do If Statements on. I need the if statement to return a value if a specific cell equals one of the names on the list. The list contains 75 people so would need multiple if statements. Instead of doing an if statement for each name on the list, is there a way for the if statement to look at the entire list at once (using a range or something)?
 
OK, back to the VLOOKUP:

ABCDEFGHIJ
CompanyDealRepAmountProductAcct. ExecRepAcct. Exec
Company xDeal 1234Joe SmithProduct XSamuel RogersRichard WatsonThomas Preston
Company DDeal 3364Bob HopeProduct PThomas PrestonBob HopeThomas Preston
Company QDeal 2575Rick BurnsProduct ANoJane DoeThomas Preston
Joe SmithSamuel Rogers
Eric PosterSamuel Rogers
Trish NixonWalter Lin
Erica AndrewsWalter Lin

<tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]$142[/TD]

[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]$443[/TD]

[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]$236[/TD]

[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]9[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet3

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH]F2[/TH]
[TD="align: left"]=IFERROR(VLOOKUP(C2,$H$2:$I$8,2,0),"No")[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Thanks Eric! That worked perfectly. I was able to use it as a nested set of code as shown here: =IFERROR(VLOOKUP($AG5,VST!B$11:C$85,2,0),IFERROR(VLOOKUP($M5,VST!B$14:C$85,2,0),IFERROR(VLOOKUP($N5,VST!B$11:C$85,2,0),IFERROR(VLOOKUP($AC5,VST!B$11:C$85,2,0)," No"))))

Do you happen to know how to do this in Microsoft Access or know of a forum that would help like this one? Thanks again!

Brian
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Glad you got it working! I'm a little curious why your second VLOOKUP has B$14 instead of B$11, but I guess you have a reason.

As for Access, my skills are way out of date. But there is an Access forum here, just post your question there.
 
Upvote 0
Thanks Eric. As for why I started on 14 for the 2nd set, the 1st three reps listed wouldn't be in the column it was searching in. Could have left it the same as the others.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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