+ Reply to Thread
Results 1 to 3 of 3

VLOOKUP WEEKDAY Function

  1. #1
    Registered User
    Join Date
    11-10-2009
    Location
    China
    MS-Off Ver
    Excel 2003
    Posts
    25

    VLOOKUP WEEKDAY Function

    Hi,

    I am editing an excel sheet with plenty of dates and have found this line of code. Can someone please explain what it means?

    =X9+VLOOKUP(WEEKDAY(X9,2),{2,4;6,3},2,0)

    I know that it is looking up the adjacent cell (X9), and if that value is a TUE, it adds 4 on to the date to return a Saturday, if it is a SAT it adds 3 on to return a TUESDAY.

    2,4 = if Weekday 2 (Tuesday), +4
    6,3 = if Saturday 6 (Saturday), +3

    but what does the 2,0 mean?

    Thanks,
    Andy

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: VLOOKUP WEEKDAY Function

    2 and 6 is column 1

    4 and 3 is column 2


    2 will return second column that is 4 or 3

    0 or 1 -> means exact/approximate match can be true/false as well...
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: VLOOKUP WEEKDAY Function

    2 in the vlookup function is column index. If the value in the first column of your (2 or 6), it will return the corresponding value in the second column (4 or 3)

    0 is the match type of vlookup. It will match the exact value. You have other match types 1(less than) or -1(Greater than)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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