+ Reply to Thread
Results 1 to 5 of 5

How to change background color of a cell to black if value is "#N/A" returned from vlookup

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    95

    How to change background color of a cell to black if value is "#N/A" returned from vlookup

    How to change background color of a cell to black if value is "#N/A" returned from vlookup? I want to use conditional formatting.

    Attached the file, pls help how to deal with F19:F38.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to change background color of a cell to black if value is "#N/A" returned from vlo

    Do you want the "#N/A" to show up. You could eleiminate it altogether

    Use in Cell F20
    =IF(P20="","",IF(ISNA(VLOOKUP(D20,INDIRECT(SUBSTITUTE(VLOOKUP(LEFT($D$15,10),SizevPantone,4,FALSE),"Pantone","")),2,FALSE)),"",VLOOKUP(D20,INDIRECT(SUBSTITUTE(VLOOKUP(LEFT($D$15,10),SizevPantone,4,FALSE),"Pantone","")),2,FALSE)))

    Alternatively, you could use conditional formatting to format cells with 'errors' as black
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to change background color of a cell to black if value is "#N/A" returned from vlo

    Hi Ohlalayeah,

    You were following correct approach, just the formula in conditional formatting need to be :-
    =ISERROR(F19)

    see attachment:- Development_Swing Ticket-20120709.xls


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to change background color of a cell to black if value is "#N/A" returned from vlo

    The IFERROR() suggestion will not work in Excel 2003 though!

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to change background color of a cell to black if value is "#N/A" returned from vlo

    yes.... you are right Ace_XL, and that's why I have suggested IsError instead of IfError

    Cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1