controlling the return text from Vlookup()

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi I want to compare 2 tables to see who attended the conference/meeting.
So I used vlookup() but what I want to do, instead of Vlookup returning the name, I want vlookup returning "Attended"! How can I do that. I managed to do the "Not Attend" only

D2=IFERROR(VLOOKUP(A2,L:L,1,FALSE),"not attend")

[TABLE="width: 264"]
<colgroup><col span="3"><col></colgroup><tbody>[TR]
[TD]name[/TD]
[TD]dept[/TD]
[TD][/TD]
[TD]attending[/TD]
[/TR]
[TR]
[TD]john1[/TD]
[TD]it[/TD]
[TD][/TD]
[TD]john1[/TD]
[/TR]
[TR]
[TD]mary1[/TD]
[TD]hr[/TD]
[TD][/TD]
[TD]mary1[/TD]
[/TR]
[TR]
[TD]david1[/TD]
[TD]sales[/TD]
[TD][/TD]
[TD]not attend[/TD]
[/TR]
[TR]
[TD]sarah1[/TD]
[TD="colspan: 2"]marketing[/TD]
[TD]sarah1[/TD]
[/TR]
[TR]
[TD]alex1[/TD]
[TD]sales[/TD]
[TD][/TD]
[TD]not attend[/TD]
[/TR]
[TR]
[TD]anna1[/TD]
[TD]admin[/TD]
[TD][/TD]
[TD]anna1[/TD]
[/TR]
[TR]
[TD]lary1[/TD]
[TD]it[/TD]
[TD][/TD]
[TD]not attend[/TD]
[/TR]
</tbody>[/TABLE]

second table in column L

[TABLE="class: grid, width: 64"]
<colgroup><col width="64" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]attended[/TD]
[/TR]
[TR]
[TD]andy1[/TD]
[/TR]
[TR]
[TD]mary1[/TD]
[/TR]
[TR]
[TD]nameir1[/TD]
[/TR]
[TR]
[TD]janet1[/TD]
[/TR]
[TR]
[TD]anna1[/TD]
[/TR]
[TR]
[TD]sarah1[/TD]
[/TR]
[TR]
[TD]kim1[/TD]
[/TR]
[TR]
[TD]andy2[/TD]
[/TR]
[TR]
[TD]john2[/TD]
[/TR]
[TR]
[TD]nameir2[/TD]
[/TR]
[TR]
[TD]janet2[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I'd suggest something like this:

=IF(ISNA(VLOOKUP(A2,L:L,1,FALSE)),"not attend","Attend")
 
Upvote 0
try

=IF(ISERROR(VLOOKUP(A2,L:L,1,FALSE)),"not attend","attended")
 
Last edited:
Upvote 0
How about
=IF(ISNA(VLOOKUP(A2,L:L,1,FALSE)),"not attend","attended")
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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