+ Reply to Thread
Results 1 to 15 of 15

Index match return min and max date

  1. #1
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Index match return min and max date

    Dear Forum Leader,

    Column A&B is contain Date and week Number for financial calendar from "time sheet" and another sheet is required format for "payslip".

    To match the year and week no return the starting to end date.

    DATA:

    DATE******WEEK NO

    20/03/2017******51
    21/03/2017******51
    22/03/2017******51
    23/03/2017******51
    24/03/2017******51
    25/03/2017******51
    26/03/2017******51

    REQUIRED FORMAT;

    YEAR *****2017*****START DATE*****20/03/2017
    WEEK NO*****51 *****END DATE *****26/03/2017
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Index match return min and max date

    in D3
    =INDEX('TIME SHEET'!A$2:A$500,MATCH(B2,IF(B3='TIME SHEET'!B$2:B$500,YEAR('TIME SHEET'!A$2:A$500)),1),1)
    Array formula, use Ctrl-Shift-Enter

    in D2
    =D3-6
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Index match return min and max date

    =MIN(IF(('TIME SHEET'!$B$2:$B$378=$B$3)*(YEAR('TIME SHEET'!$A$2:$A$378)=$B$2),'TIME SHEET'!$A$2:$A$378))

    =MAX(IF(('TIME SHEET'!$B$2:$B$378=$B$3)*(YEAR('TIME SHEET'!$A$2:$A$378)=$B$2),'TIME SHEET'!$A$2:$A$378))

    BOTH ..confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

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

    Re: Index match return min and max date

    In D2

    =INDEX('TIME SHEET'!A2:A378,MATCH(B3,'TIME SHEET'!B2:B378,0))

    In D3

    =D2+7

  5. #5
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Re: Index match return min and max date

    Thank you so much for index formula Special-K and kvsrinivasamurthy.

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Index match return min and max date

    kvsrinivasamurthy 's formula is the best as it's not an Array formula.

  7. #7
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Re: Index match return min and max date

    JohnTopley: thank you so much for max and min formula.

    I have small query suppose in B2 is month and year how do achieve the same result.Its really helpful i have avoid one additional column.

    B2 is like Mar-17, April-17, Mar-18.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Index match return min and max date

    =MIN(IF(('TIME SHEET'!$B$2:$B$378=$B$3)*('TIME SHEET'!$A$2:$A$378>=$B$2)*('TIME SHEET'!$A$2:$A$378<=EOMONTH($B$2,0)),'TIME SHEET'!$A$2:$A$378))

    =MAX(IF(('TIME SHEET'!$B$2:$B$378=$B$3)*('TIME SHEET'!$A$2:$A$378>=$B$2)*('TIME SHEET'!$A$2:$A$378<=EOMONTH($B$2,0)),'TIME SHEET'!$A$2:$A$378))


    Not sure why you want month if you have week number.

    So what is expected result with month/year?

  9. #9
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Index match return min and max date

    Dera "silambarasan.J", You can also do this. Refer attach file.

    In timesheet : Add helper column "C" with formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copy down.
    In payslip sheet : in "D2"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In "D3"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    [Array formula, use Ctrl-Shift-Enter]
    Attached Files Attached Files


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  10. #10
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Re: Index match return min and max date

    thank you so much AVK. its really helpful and learn new thing.

    Thanks a lot

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Index match return min and max date

    MAX (as mentioned in other posts) can be MIN result + 6 so no need for MAX formula.

    And why not use the non-array formulae others provided.

  12. #12
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Index match return min and max date

    Quote Originally Posted by kvsrinivasamurthy View Post
    In D2

    =INDEX('TIME SHEET'!A2:A378,MATCH(B3,'TIME SHEET'!B2:B378,0))

    In D3

    =D2+7
    Nicely done by Kvsrinivasmurthy but there is two years in time sheet column A

    When we change in payslip sheet year cell B2 into 2018 it would not work. Then Try

    D2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    D3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    same as he said.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  13. #13
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Index match return min and max date

    Thanks & welcome "silambarasan.J "
    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  14. #14
    Forum Contributor
    Join Date
    08-07-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    372

    Re: Index match return min and max date

    Quote Originally Posted by JohnTopley View Post
    =MIN(IF(('TIME SHEET'!$B$2:$B$378=$B$3)*('TIME SHEET'!$A$2:$A$378>=$B$2)*('TIME SHEET'!$A$2:$A$378<=EOMONTH($B$2,0)),'TIME SHEET'!$A$2:$A$378))

    =MAX(IF(('TIME SHEET'!$B$2:$B$378=$B$3)*('TIME SHEET'!$A$2:$A$378>=$B$2)*('TIME SHEET'!$A$2:$A$378<=EOMONTH($B$2,0)),'TIME SHEET'!$A$2:$A$378))


    Not sure why you want month if you have week number.

    So what is expected result with month/year?
    Thank you so much for your reply and response. Its really interesting eomonth and max/min

    you are right. If I have a week No there is no need for month. Apology am not explain properly about my requirements.

    But my requirement is different. I am try to apply based on your formula, its working but I am not sure it right or wrong?

    =MIN(IF(('TIME SHEET'!$D$2:$D$378=$B$3)*YEAR('TIME SHEET'!$B$2:$B$378)=YEAR($B$2),'TIME SHEET'!$B$2:$B$378))
    =MAX(IF(('TIME SHEET'!$D$2:$D$378=$B$3)*YEAR('TIME SHEET'!$B$2:$B$378)=YEAR($B$2),'TIME SHEET'!$B$2:$B$378))

    Please suggestion. File attached for your reference.
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Index match return min and max date

    Again ... not clear what you want: week 4 is in April so based on the year, it is returning the correct result.

+ 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] Index / Match - match 3 input values and return the results from the index
    By t83357 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2016, 07:34 PM
  2. [SOLVED] Index Match-return an amount if a date falls between two dates
    By HRpersonnel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-09-2016, 12:06 AM
  3. Index + Match + Lookup -- return next largest date
    By bgoodsell in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-30-2015, 05:48 PM
  4. Replies: 0
    Last Post: 04-12-2015, 07:36 PM
  5. Replies: 14
    Last Post: 04-09-2015, 12:43 PM
  6. [SOLVED] IF date value returned from Index/Match is blank, return prior cell that returns a value
    By gunnerau in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-11-2014, 08:40 PM
  7. Replies: 3
    Last Post: 08-17-2010, 02:54 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