If "#N/A" is returned, replace this value with "NO DATA")

iansammcluckie

New Member
Joined
Jul 21, 2010
Messages
4
Hi.

I am using the following vlookup:
=VLOOKUP(LEFT($A2,8)&"*",Dashboard_EA!$A$199:$P$213,5,0).

When the formula is not finding a value, it is returning #N/A.
I wish to replace this #N/A with "NO DATA".

Please advise me on how I should write the formula.

Thank you.
 

Some videos you may like

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

lynxbci

Board Regular
Joined
Sep 22, 2004
Messages
198
Office Version
365
Platform
Windows, MacOS
Hi,

=if(ISNA(VLOOKUP(LEFT($A2,8)&"*",Dashboard_EA!$A$199:$P$213,5,0)),"No Data",
VLOOKUP(LEFT($A2,8)&"*",Dashboard_EA!$A$199:$P$213,5,0))

Kev
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,192
Hi.

I am using the following vlookup:
=VLOOKUP(LEFT($A2,8)&"*",Dashboard_EA!$A$199:$P$213,5,0).

When the formula is not finding a value, it is returning #N/A.
I wish to replace this #N/A with "NO DATA".

Please advise me on how I should write the formula.

Thank you.
Excel 2007 and beyond:
Rich (BB code):
=IFERROR(VLOOKUP(LEFT($A2,8)&"*",Dashboard_EA!$A$199:$P$213,5,0),"NO DATA")
Prior versions:
Rich (BB code):
=IF(ISNUMBER(MATCH(LEFT($A2,8)&"*",Dashboard_EA!$A$199:$A$213,0)),
    VLOOKUP(LEFT($A2,8)&"*",Dashboard_EA!$A$199:$P$213,5,0),
    "NO DATA")
 

iansammcluckie

New Member
Joined
Jul 21, 2010
Messages
4
SOLVED_Re: If "#N/A" is returned, replace this value with "NO DATA")

Hi Aladin Akyurek and lynxbci.

Thanks for your help, it is solved.

Ian
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,580
Messages
5,512,178
Members
408,882
Latest member
Clarab9

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top