+ Reply to Thread
Results 1 to 4 of 4

Complex formula to multi-extract smallest and largest date in various ranges

  1. #1
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    215

    Question Complex formula to multi-extract smallest and largest date in various ranges

    Hi all,

    I have a bit of a complex problem to solve...not even ChatGPT was able to handle :D

    Bit of a description (all in an Excel table):

    1) Cells in range C12:C111 can have one of the following three values: Stage, Task or Milestone
    2) Range M12:M111 contains start dates, but only shows where the respective cell in column C is Task or Milestone
    3) Range N12:N111 contains end dates, but only shows where the respective cell in column C is Task or Milestone
    4) I want to extract the earliest (min) as well as the latest (max) date from the two date ranges for all Task or Milestone values between the Stages. Example:


    C12 = Stage, C13 = Milestone or Task, C14 = Milestone or Task, C15 = Stage, C16 = Milestone or Task, C17 = Milestone or Task, C18 = Milestone or Task, C19 = Milestone or Task, C20 = Stage....
    In this case, the expected outputs in M12 would be the earliest date of range M13:M14, the expected output in N12 would be the latest date of range N13:N14, the expected output in M15 would be the earliest date of range M16:M19 and the expected output in N15 would be the latest date of range N16:N19 and so on.

    The complexity is that new rows can be added at any point in time (as said, it's in an Excel table) so the formulae need to be so dynamic to identify where all the stages are and calculate the in-between min and max dates for each stage that occurs. Hope that makes sense...

    Attached is a screenshot of what I am trying to achieve...

    This is what ChatGPT recommended, but it returns 0 (indicated as Sat, Jan 00 1900 in screenshot) for when the respective value in column C is "Stage"...

    Min Date:

    Please Login or Register  to view this content.
    Max Date:

    Please Login or Register  to view this content.
    Sadly can't share the actual file as contains confidential data I can't easily strip out, sorry.

    Any smart folks out there who can help solve this problem? Thanks so much!
    Attached Images Attached Images
    Last edited by kingofcamden; 05-23-2024 at 08:47 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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,197

    Re: Complex formula to multi-extract smallest and largest date in various ranges

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: 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. The sample layout accurately matches that of your real data. 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
    Forum Contributor
    Join Date
    08-25-2015
    Location
    London
    MS-Off Ver
    MS 365
    Posts
    215

    Re: Complex formula to multi-extract smallest and largest date in various ranges

    Hi there - managed to solve myself using a few helper columns. Closing as solved.

  4. #4
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,197

    Re: Complex formula to multi-extract smallest and largest date in various ranges

    Thanks for letting us know. I could have done it easily if I'd known that helper columns were allowed!

    ChatGPT makes a real hash of these things - it's really best avoided.

+ 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] Extract Largest and Smallest Items with Conditions
    By andrewc in forum Excel General
    Replies: 4
    Last Post: 04-06-2020, 02:26 PM
  2. Largest positive & Smallest negative with multi conditions
    By bittubadri in forum Excel General
    Replies: 15
    Last Post: 11-11-2019, 05:19 AM
  3. [SOLVED] how to extract the smallest and largest numbers
    By rcahayag1925 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2019, 11:54 PM
  4. Replies: 7
    Last Post: 06-20-2016, 08:37 AM
  5. Segregating entries by date and then by smallest/largest purchase
    By Trillium15 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-07-2015, 11:27 AM
  6. [SOLVED] Extract largest or smallest value from a CELL
    By brad999 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-09-2013, 04:49 AM
  7. [SOLVED] Formula to extract top largest to smallest amount based on 3 criterias
    By aurisab in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-26-2013, 08:05 AM

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