Comparing cells via Vlookup then returning text

antinora

Board Regular
Joined
Dec 4, 2013
Messages
87
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
 

Excel Facts

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

=IF(ISNA(MATCH(A2,abs!$A1:$A$748,0)),"Present","Absent")
 
Upvote 0
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")
 
Upvote 0
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"))?
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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