+ Reply to Thread
Results 1 to 5 of 5

Help getting a V Lookup to return a blank based on cell value

  1. #1
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Help getting a V Lookup to return a blank based on cell value

    Hi all. Please see attached sheet. I have a VLookup which will add start/finish and meal relief times. I am trying to figure out how to leave a cell blank for a day when the times are not required. In the sheet I only want the times to show on Mon, Wed, Thu and Fri. For Tue, Sat and Sun I want the times blank.
    What I need os for the VLookup to return a blank cell when the weekday cell value is '*'
    What am I missing?

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Help getting a V Lookup to return a blank based on cell value

    you could add this to the vlookup... in D7 =IF(OR(D4="Tuesday","Saturday","Sunday"),"",IFERROR(VLOOKUP(A7,'Duty Times'!$A$1:$B$530,2,0),""))
    this in H7... =IF(OR(H4="Tuesday","Saturday","Sunday"),"",IFERROR(VLOOKUP(E7,'Duty Times'!$A$1:$B$530,2,0),""))

    You'll have to adjust it for each of the cells in row 7 since your lookups vary in each cell.

    but I would do my best to get rid of the merged cells in row 4 as they will mess up the formula if you are trying to drag it toward the right. (maybe one row hidden with the day of the week above D4 and E4 and F4 etc where it says Monday, then same for H4 etc for Tuesday.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Help getting a V Lookup to return a blank based on cell value

    In D7 using your formula as a base, for example,
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I would switch from VLOOKUP to INDEX/MATCH and modify your table on Duty Times so that the headers match what's in Row 4 of MASTER. Then you can just copy D7 across and down rather than reinventing the wheel.

    Then the base formula would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and to make it skip Tues,Sat and Sun
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    See Row 8 of attached workbook.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Re: Help getting a V Lookup to return a blank based on cell value

    Many thanks. The shaded cells all have a value of * in them so I have changed it to the following based on your help
    =IF(OR(AF7="*"),"",IFERROR(VLOOKUP(A7,'Duty Times'!$A$1:$B$530,2,0),""))
    I'd just like to say thank you very much.

  5. #5
    Registered User
    Join Date
    07-12-2019
    Location
    England
    MS-Off Ver
    365
    Posts
    64

    Re: Help getting a V Lookup to return a blank based on cell value

    Quote Originally Posted by ChemistB View Post
    In D7 using your formula as a base, for example,
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I would switch from VLOOKUP to INDEX/MATCH and modify your table on Duty Times so that the headers match what's in Row 4 of MASTER. Then you can just copy D7 across and down rather than reinventing the wheel.

    Then the base formula would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and to make it skip Tues,Sat and Sun
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    See Row 8 of attached workbook.
    Thank you. I didn't see your reply until I had finished modifying Sambo Kid's formula as above. I appreciate your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] V lookup - return value in another column if cell within v-lookup column is blank
    By Jacks18928 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2019, 06:46 AM
  2. [SOLVED] Vlookup to return Yes or No based on cell blank or not
    By fastcar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2019, 12:29 PM
  3. [SOLVED] Lookup Next Blank Cell and Return Adjacent Cell
    By Ollie7957 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-29-2016, 05:02 AM
  4. Lookup a blank cell in a Lookup table and return a figure.
    By jonnops in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-20-2014, 07:33 AM
  5. How to return a blank cell based on if then criteria
    By azucar360 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-01-2013, 04:05 PM
  6. VLOOKUP CONDITION TO RETURN BLANK CELL WHERE LOOKUP VALUE IS NOT IN TABLE ARRAY
    By Scott Lolmaugh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2006, 07:10 PM
  7. [SOLVED] Return of blank cell if lookup fails
    By TimM in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-23-2005, 12:40 PM

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