Solved

Using an IF statement to sort data

Posted on 2015-02-03
4
61 Views
Last Modified: 2015-02-03
I am attempting to identify the minimum value occurs before the maximum value, but would like to know if there is a function that I can use, rather than using a macro.

In detail, in row 4, I find the minimum value of 2 and the maximum value of 410.  I would like to return the date (the header row) of the minimum value and the date of the maximum value IF the minimum value occurs before the maximum value.  If the maximum value occurs before, then return nothing.

I have been racking my brain with an IF statement or a combination of IF and range, but am drawing  a blank.  I have a sparkline in place to help visualize how the values fluctuate.
0
Comment
Question by:Sabealgo
  • 2
4 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 40587096
Did you intend to upload a file?
0
 

Author Comment

by:Sabealgo
ID: 40587105
I did. Sorry.  here it is.
SAMPLE.xlsx
0
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 40587311
In row 4, use these formulas...

    =IF(MATCH(MIN(C4:V4), C4:V4, 0)<MATCH(MAX(C4:V4), C4:V4, 0), INDEX(C$2:V$2, MATCH(MIN(C4:V4), C4:V4, 0)), "")
    =IF(MATCH(MIN(C4:V4), C4:V4, 0)<MATCH(MAX(C4:V4), C4:V4, 0), INDEX(C$2:V$2, MATCH(MAX(C4:V4), C4:V4, 0)), "")

Note that if the Min or Max values occur twice, only the date for the first occurrence will be returned.
0
 

Author Closing Comment

by:Sabealgo
ID: 40587330
Thank you for your help.  This works.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now