+ Reply to Thread
Results 1 to 2 of 2

Min and Max formula

Hybrid View

  1. #1
    Registered User
    Join Date
    04-10-2009
    Location
    Colorado
    MS-Off Ver
    Excel 2016
    Posts
    30

    Min and Max formula

    Hi all, hoping someone out there can help with a formula regarding Min and Max date. The snapshot image I've attached is for a patient who had surgery and was administered medication during the surgery. The data is showing what appears to be duplicate rows, but the query is actually creating a new row when the administration date/times change for the documentation of the administered medication over the course of several days. This is also demonstrated in the example Excel file I've attached.

    What I would like to achieve is a formula that searches the unique ID's called "HAR" in column A. If the ID [HAR] matches the ID [HAR] above it, then I would like the formula to take the Min date/time from column Y, "First_MedAdminDate" and the Max date/time from column Z, "Last_MedAdminDate" and place these results on one row in separate columns. I'm also thinking there needs to be a nested formula that also looks at column AC, "Med Order Route" and if it changes, then it repeats the Min and Max formulas on that row. Essentially I'm hoping for it to look like the snapshot I've attached allowing me to eliminate columns Y & Z altogether so I can remove duplicates from the dataset.

    Hopefully this makes sense with the attachment examples I've provided.

    Thanks!
    kdestef1

    Min Max Example.JPG
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Min and Max formula

    You should be able to do this with a pivot table.

    I converted the data into an Excel Table mainly because Excel tables "know" how big they are and formulas, charts and pivot tables built on them automatically adjust to the amount of data in the table.

    Then I built the pivot table shown on Sheet2.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  2. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  3. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  4. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  5. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04: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