IF(ISNA...) with VLOOKUP on another worksheet to return "M" if not present on other worksheet?

kznadalin

New Member
Joined
Jun 16, 2010
Messages
44
Hi, everyone,

I have two worksheets with a list of students on each one, "lib_checkin" and "lib_hah." Only some of the students on "lib_checkin" are listed on "lib_hah," along with the period that they have a class.

If they ARE listed on "lib_hah," I want to return the value of what period that they are in class on the "lib_checkin" sheet, which is currently working.
If they are NOT listed on "lib_hah," I would like to get the result returned as just the letter M, but right now, I'm getting #NAME? instead.

<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}span.s1 {color: #006107}span.s2 {color: #ab30d6}span.s3 {color: #0057d6}</style>=IF(ISNA(VLOOKUP(A15,lib_hah!$A:$G,5,0)),”M”,VLOOKUP(A15,lib_hah!$A:$G,5,0))


Any help is appreciated.
Thanks,
Karen
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
49,220
Office Version
  1. 365
Platform
  1. Windows
If you are using Excel 2013 (I think) or later, you can write that formula more simply as:

=IFNA(VLOOKUP(A15,lib_hah!$A:$G,5,0),"M")


For some older versions you could also use this unless it is specifically #N/A errors that you are trying to trap

=IFERROR(VLOOKUP(A15,lib_hah!$A:$G,5,0),"M")
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,133,625
Messages
5,659,941
Members
418,538
Latest member
alc51103

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