Comparing cells via Vlookup then returning text

antinora

Board Regular
Joined
Dec 4, 2013
Messages
85
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I'm blanking on a nested If statement. I have 2 worksheets. In sheet 1 a a list of student ID numbers. In sheet 2 is a list of student ID numbers for daily absentees. I want to compare both columns of IDs and return Presents if m atch else Absent.

Since no match returns #N/A the formula I'm using returns Present but I want Present else Absent.

I'm using =IFERROR(VLOOKUP(A2,abs!$A$1:$A$748,1,FALSE),"Present")

Is there a If then else vlookup type nested formula?

Thank you
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,410
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Untested, but try this:

=IF(ISNA(MATCH(A2,abs!$A1:$A$748,0)),"Present","Absent")
 

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,066
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm blanking on a nested If statement. I have 2 worksheets. In sheet 1 a a list of student ID numbers. In sheet 2 is a list of student ID numbers for daily absentees. I want to compare both columns of IDs and return Presents if m atch else Absent.

Since no match returns #N/A the formula I'm using returns Present but I want Present else Absent.

I'm using =IFERROR(VLOOKUP(A2,abs!$A$1:$A$748,1,FALSE),"Present")

Is there a If then else vlookup type nested formula?

Thank you
I would prefer to use a MATCH function but following your convention, try the below
Excel Formula:
 IF(ISNA(VLOOKUP(A2,abs!$A$1:$A$748,1,FALSE)),"Present" ,"Absent")
 

MuchToLearn

New Member
Joined
Dec 15, 2008
Messages
24
Office Version
  1. 2019
  2. 2016
  3. 2013
  4. 2010
Platform
  1. Windows
Assuming old Student ID are unique in each sheets, and Student ID in 'sheet abs' is subset of Student ID in "sheet1", why not just use =IF(COUNTIF(abs1!$A$1:$A$748, A2)=0,"Present","Absent"))?
 

Watch MrExcel Video

Forum statistics

Threads
1,127,040
Messages
5,622,343
Members
415,894
Latest member
silverhaze

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