+ Reply to Thread
Results 1 to 7 of 7

Lookup in array based on weekday

  1. #1
    Registered User
    Join Date
    04-01-2016
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    56

    Lookup in array based on weekday

    My excel abilities are moderate, and I haven't used it for about a year, so apologies if this is a daft question.

    I have a calendar spreadsheet that needs to lookup some information from an array. Both the calendar date and the array data are populated by a user from a userform.

    I need to lookup information from the array, based on what day of the week is in a particular cell (but the day can be any weekday depending on what starting date the user entered). I started writing an 'IF' formula - 'if cell is a monday, take the info from this cell', but it occurred to me that even if that worked with 5 different ifs in every cell, there must be a more efficient way of doing this, perhaps with H or Vlookup.

    Attached is a dummy of my problem, with the desired result on the second sheet in italics. Please could someone help me out? Thank you very much.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-12-2016
    Location
    England, UK
    MS-Off Ver
    MS 365
    Posts
    59

    Re: Lookup in array based on weekday

    Try this in cell C4 on the Desired Result Tab. Put Monday in Cell C2

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: Lookup in array based on weekday

    Try placing the following formula in cell C4 of the Desired Result sheet and drag-copying it down as needed:

    =IF(LEN(VLOOKUP(B4,db!$A$3:$F$12,MATCH(TEXT(B$2,"dddd"),db!$A$2:$F$2,0),0)),VLOOKUP(B4,db!$A$3:$F$12,MATCH(TEXT(B$2,"dddd"),db!$A$2:$F$2,0),0),"")

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Lookup in array based on weekday

    Try
    =VLOOKUP(B4,db!$A$3:$F$12,WEEKDAY($C$2),FALSE)

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Lookup in array based on weekday

    In C4 then copy to other required range.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-01-2016
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Lookup in array based on weekday

    Quote Originally Posted by Root_ View Post
    Try placing the following formula in cell C4 of the Desired Result sheet and drag-copying it down as needed:

    =IF(LEN(VLOOKUP(B4,db!$A$3:$F$12,MATCH(TEXT(B$2,"dddd"),db!$A$2:$F$2,0),0)),VLOOKUP(B4,db!$A$3:$F$12,MATCH(TEXT(B$2,"dddd"),db!$A$2:$F$2,0),0),"")
    This worked , thank you

  7. #7
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: Lookup in array based on weekday

    You are welcome.

+ 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] Returning row value based on multiple criterias in array (not tables). IF ? Lookup ?
    By KomicJ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2016, 05:08 AM
  2. [SOLVED] VLOOKUP with a WEEKDAY lookup value
    By tas666 in forum Excel General
    Replies: 4
    Last Post: 12-15-2015, 06:25 AM
  3. Lookup functions based on array position
    By FJMoussally in forum Excel General
    Replies: 8
    Last Post: 07-27-2015, 09:34 PM
  4. [SOLVED] Calculate weekday end date based on sum of weekday start date and cell value
    By Rerock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2014, 09:17 AM
  5. Array Formula with Month, Date and Weekday - Breaking down
    By Alienontherun in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2013, 04:56 AM
  6. [SOLVED] Array lookup formuls, nesting in ifs, based off of a pivot slicer
    By jenncess in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-29-2013, 05:37 PM
  7. formula on getting weekday with lookup to other tab.
    By albert28 in forum Excel General
    Replies: 1
    Last Post: 04-08-2010, 12:00 PM

Tags for this Thread

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