+ Reply to Thread
Results 1 to 16 of 16

Date match

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Date match

    Hello everyone,

    I am trying to find a formula that will populate a cell based on a date range. In the example below column F needs to add the relevant company year based on if the date (in column E) falls in the company year grid. Example:
    Screen Shot 2017-12-23 at 17.44.40.jpg

    Below, I have manually added in the company years into column F as I cannot work out the formula that will do this for me automatically:
    Screen Shot 2017-12-23 at 17.44.31.jpg


    And just to further clarify. In the example below 8 February 2019 is between 1 November 2018 - 31 October 2019 and therefore falls into Year 3. Year 3 has therefore been added into column F:
    Screen Shot 2017-12-23 at 17.44.10.jpg



    I hope this makes sense.

    Thank you in advance for any help,

    Regards,

    Margate
    Attached Files Attached Files
    Last edited by Margate; 12-23-2017 at 04:46 PM. Reason: To attach a sample workbook

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Date match

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Date match

    File attached.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,370

    Re: Date match

    Looking at your picture, it looks like a basic lookup function with the binary/approximate match option selected. Unfortunately, it seems that almost all examples across the internet are for the linear search/exact match option, so this possibility often gets underrepresented in searching the internet.

    =MATCH(E2,$B$2:$B$6,1) would return 1 (meaning first row, not necessarily first year, but, since your example shows row#=year#, this is an insignificant distinction). Note the mix of relative and absolute references so that this can easily be copied down.

    If it helps, I recommend reviewing the help file https://support.office.com/en-us/art...9-533f4a37673a
    Also, I have an example here using VLOOKUP() of how this binary search option works: https://www.excelforum.com/tips-and-...p-example.html
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Date match

    Thank you MrShorty, I will take a look at these. I did search the internet but as you mentioned there was nothing hence this post

  6. #6
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Date match

    I have given up on that way as it is too complicated! Instead I have made a grid that contains the year and months. Is there a way of using Index Match to locate the year?

    For example, if the date in one of the cells in column H is 31 July 2017 then I will need to use Index Match to search for July and 2017 in the company year grid. I tried to find a solution as
    there are a lot of tutorials for Index Match but because it is using strings and pulling apart the date I got very confused!
    I have attached an excel fie named Alternative.xlsx and also a screen shot.
    Screen Shot 2017-12-23 at 20.01.36.jpg
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,370

    Re: Date match

    I have given up on that way as it is too complicated!
    I apologize in advance for being combative, but your solution to the previously "complicated" solution is to make it even more complicated?

    Before going down this new rabbit hole you are digging, can I ask what about my suggested function did not work? As simple as that function should have been to enter and copy down, I am having trouble understanding why it was "too complicated."

  8. #8
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Date match

    MyShorty,

    I am really not very good in Excel and to be honest I struggle my way through. I have spent hours trying to work out a solution and the only way I can kind of relate a "solution" is to do what i have done before and build a grid / use Index Match. Problem is when I tried to do that I realised (probably wrongly) that I would need to do two different matches, 1 for the month and then one for the year, again it's very complicated for me as I really am not very strong with the program.

    I downloaded your spreadsheet but did not really understand it. Maybe I am just out of my depth with this one. I will try and work something out or re-do my sheet.

    Thank you very much for your help.

  9. #9
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Date match

    Why are you guys making this so complicated?

    Extract the year, subtract 2015 gives your number.

    Eg 2016-2015 =1

    Formula for I2
    Formula: copy to clipboard
    =YEAR(H2)-2015



    Going back to post #1

    This formula would have worked for F2:-
    Formula: copy to clipboard
    =YEAR(E2)-2016+IF(MONTH(E2)>10,1,0)
    Attached Files Attached Files
    Last edited by mehmetcik; 12-23-2017 at 05:17 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Date match

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  11. #11
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Date match

    Done. I have attached a spreadsheet (My attempt.xlsx) following your instructions. I have one of my attempts at a solution in but it does not work at all.

  12. #12
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Date match

    f2=LOOKUP(E2,$B$2:$B$6,$A$2:$A$6)
    =LOOKUP(E2,$B$2:$B$6,$A$2:$A$6)
    Try this and copy towards down
    if the result is in date format, change the cell format as general/number

  13. #13
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Date match

    Perfect. Seems like quite a straight forward formula! I may may have been over complicating it but there is just so much going on in Excel that I just get totally confused especially after trying to find solutions for several hours!

    Thank you very much for your help and patience. This is caused me a real headache!

    Much appreciated.

    Margate.

  14. #14
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Date match

    what is your expected result for H10

  15. #15
    Forum Contributor
    Join Date
    01-18-2013
    Location
    England
    MS-Off Ver
    2016 (Mac)
    Posts
    149

    Re: Date match

    H10 should be 3. Screenshot attached:
    Screen Shot 2017-12-23 at 21.16.42.jpg

  16. #16
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Date match

    then try
    I10=
    =INDEX($B$11:$F$22,MATCH(TEXT($H10,"mmmm"),$A$11:$A$22,0),MATCH(YEAR($H10),$B$10:$F$10,0))
    AND COPY TOWARDS DOWN

+ 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. Index Match to find match date to a range of dates
    By downcrusher in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2017, 06:05 PM
  2. [SOLVED] How to Match or Lookup the the qty to other specific cell that match the date
    By JESSHOR60 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-11-2015, 04:20 AM
  3. Replies: 2
    Last Post: 12-18-2014, 09:52 AM
  4. [SOLVED] Index Match Based on One Date Criteria, Table Contains Beginning Date and End Date
    By jcox1953 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2014, 02:41 PM
  5. [SOLVED] INDEX date that MATCH on date range, MATCH code(string)
    By Dahlia in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2014, 03:33 AM
  6. Replies: 5
    Last Post: 01-07-2012, 10:17 AM
  7. Replies: 5
    Last Post: 01-06-2012, 08: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