+ Reply to Thread
Results 1 to 19 of 19

Get the Relative Date From Prior Year

  1. #1
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Get the Relative Date From Prior Year

    Hello all,
    I have 2 tables 2022 and 2023 each set up with the same columns

    The Date column contains duplicates, this formula gives me the total unique days

    Please Login or Register  to view this content.
    How do I do the reverse, for let's say the 83rd Production day in 2023 (from the the 2023 table it is 23-Apr-2023), how do I get the date of the 83rd day in the 2022 table. Not using the 83rd calendar day because if no work is done on certain days, those days won't count towards the actual work days. I want to get the 83rd date from the array.


    Edit: Attached Workbook
    TEST.xlsx
    Last edited by admat; 04-25-2023 at 11:19 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,948

    Re: Get the Relative Date From Prior Year

    There are instructions at the top of the page explaining how to attach your sample workbook. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    there is no 23-Apr-2023 in your example

  4. #4
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Re: Get the Relative Date From Prior Year

    Sorry about the typo. The 83rd instance of a unique date is 24-Apr-2023. The table is a WIP.

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    there is no table WIP in your example

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    you've two tables only: PROD2023 and PROD2022
    that's all with tables

  7. #7
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Re: Get the Relative Date From Prior Year

    Oh, no. The Workbook is a work in progress, lol. I have to sort out the data still.
    I wanted to get the 83rd Date from PROD2022 before going forward.

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    but in table 2022 you have 41 distinct dates only

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    table 2022 contains 41 distinct dates
    table 2023 contains 83 distinct dates
    I suggest to create manually expected result and detailed description of your logic
    with a few different examples

  10. #10
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Re: Get the Relative Date From Prior Year

    I pasted all the data to the PROD2022 table

    TEST v2.xlsx

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    is that what you want?

    Position Production Date
    83
    26/04/2022


    or

    Position Production Date
    20
    24/01/2022


    or

    Position Production Date
    211
    20/10/2022

  12. #12
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Re: Get the Relative Date From Prior Year

    Only checking from the 1st of January for each year:

    Removing all the Date duplicates from PROD2022, the 79th date is 25-Apr-2022

    For PROD2023 the 79th date is 23-Apr-2023


    The 18th Date in PROD2023 is 26-Jan-2023

    The 18th Date in PROD2022 is 25-Jan-2022

    These are the results I'm looking for.
    Last edited by admat; 04-25-2023 at 04:17 PM.

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    I will ask the question a second time: is this what you want to achieve?

    the dates in both tables are sorted ascending?

    I'm not follow your logic how you get the result from post#12 ?
    could you explain it step by step?
    Last edited by sandy666; 04-25-2023 at 04:58 PM.

  14. #14
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Re: Get the Relative Date From Prior Year

    Starting over...

    Using the Production Date Column with records from January 1st
    If you remove all duplicates and sort the remaining dates ascending. I want to be able to return the nth date from each table.
    So if the 18th Date in PROD2023 is 26-Jan-2023 I need a formula to find the 18th Date in PROD2022

  15. #15
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    eighteenth position from distinct dates in PROD2023 is 28/03/2023 (without sorting!)
    that is why I asked about explaining your logic how do you calculate the eighteenth position
    You don't explain, you just repeat the same thing over and over again
    I cannot help with formula but I can do that via Power Query
    i can show from both tables the date in 18th position at the same time

    after sort asc both tables 18th position is
    20/01/2022
    18
    20/01/2023
    18
    Last edited by sandy666; 04-25-2023 at 08:20 PM.

  16. #16
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Re: Get the Relative Date From Prior Year

    I extracted the unique dates from each table. I see the count is returning different dates

    Edit:
    2022.jpg

    2023.jpg
    Last edited by admat; 04-25-2023 at 09:16 PM.

  17. #17
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Get the Relative Date From Prior Year

    your attachments are not accessible
    see yellow banner at the top of this page how to attach file(s) properly

  18. #18
    Registered User
    Join Date
    12-21-2018
    Location
    Piarco, Trinidad
    MS-Off Ver
    2016
    Posts
    39

    Re: Get the Relative Date From Prior Year

    I think I may have solved it.

    First I took all the Production Date out and created an array removing all the duplicates.
    Next to that array, I numbered each date.
    On the main table, I added a column using an Index and Match to give me the Count of the Production Date

    Count Work Day.jpg

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,948

    Re: Get the Relative Date From Prior Year

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered 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. Calculation of Current year vs. Prior year
    By Pearl_022 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-01-2021, 11:36 AM
  2. [SOLVED] Adaptive Date Relative, Month Count in Given Year!!!
    By DemRulesDoe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-28-2017, 12:42 PM
  3. Date one year prior
    By goodboy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-26-2016, 07:14 AM
  4. Replies: 2
    Last Post: 03-14-2014, 08:47 PM
  5. [SOLVED] Return Date as Month Name and Year in versions prior to 2007
    By PhatRam32 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-11-2013, 09:40 AM
  6. Cells w/Date Formats should know when to use current/prior year
    By Donna Fernandez in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-01-2005, 04:25 PM
  7. [SOLVED] How to compare current year to prior year in bar chart?
    By substring in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 05-12-2005, 02:06 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