Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Determining "Highest Since" or "Lowest Since".

Determining "Highest Since" or "Lowest Since"

by Allen Wyatt
(last updated January 28, 2020)

7

Alex routinely analyzes the latest building industry data, and needs to write articles about the data. Frequently he needs to highlight some new piece of data, such as "industrial building construction was the lowest since August 2019." Alex wondered if there was a way to automate this type of highlighting; if column A contains the month and year and column B contains the values for those periods, Alex would like a formula in column C that indicates "this value is the highest since April 2019" or "this value is the lowest since November 2016."

Assuming that the month and year listed in column A is really an Excel date value (and not text), you can easily create a formula to return the desired information. If you have row 1 occupied with headings for your columns, enter the following in cell C2:

=IF(ROW(B2)=2,"",IF(B2>MAX($B$1:B1), "this value is 
the highest since " & TEXT(INDEX($A$1:A1,MATCH(MAX(
$B$1:B1),$B$1:B1,0)), "mmmm yyyy"), IF(B2<MIN($B$1:B1),
"this value is the lowest since " & TEXT(INDEX($A$1:A1,
MATCH(MIN($B$1:B1),$B$1:B1,0)), "mmmm yyyy"),"")))

Remember that this is a single formula, and should be entered all on one line. You can copy the formula down as many rows as necessary in column C, and it should provide the desired information. It only makes a notation in column C if the value in column B is greater than the maximum or less than the minimum of all the foregoing values in column B.

If you have quite a bit of data in your worksheet, you could notice that the formula results in long recalculation times. If this is the case, then you may want to consider using a macro that will do the desired analysis and provide the appropriate information. The following macro looks backward through the information in column B and provides both a "lowest since" and "highest since" result in columns C and D.

Sub FindHiLow()
    Dim orig_cell As Range
    Dim orig_val As Integer
    Dim orig_row As Integer
    Dim rownum As Integer
    Dim newcell As Range
    Dim new_val As Integer
    Dim lowrow As Integer
    Dim hirow As Integer

    Set orig_cell = ActiveCell
    orig_row = ActiveCell.Row
    orig_val = orig_cell.Value

' find lowest
    lowrow = 0
    For rownum = orig_cell.Row - 1 To 1 Step -1
        Set newcell = Cells(rownum, 2)
        new_val = newcell.Value
        If orig_val >= new_val Then
            lowrow = rownum
            Exit For
        End If
    Next
    If lowrow = 0 Then lowrow = 1
    Cells(orig_row, 3).Value = "Lowest since " & Cells(lowrow, 1)

' find highest
    hirow = 0
    For rownum = orig_cell.Row - 1 To 1 Step -1
        Set newcell = Cells(rownum, 2)
        new_val = newcell.Value
        If orig_val <= new_val Then
            hirow = rownum
            Exit For
        End If
    Next
    If hirow = 0 Then hirow = 1
    Cells(orig_row, 4).Value = "Highest since " & Cells(hirow, 1)
End Sub

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10183) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Determining "Highest Since" or "Lowest Since".

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Unique Name Entry, Take Two

If you need to make sure that a column contains only unique text values, you can use data validation for the task. This ...

Discover More

Comma-Delimited and MS-DOS CSV Variations

Excel provides different file formats you can use to export your worksheet information. One such file format is CSV, or ...

Discover More

Working with Record Numbers

Want to keep track of various rows in a data table through the use of record numbers? Here are some options and ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Calculating an Expanding Square

When doing a systematic search for rescue purposes, it isn't unusual to implement what is termed an "expanding square." ...

Discover More

Indirectly Referencing a Cell on a Different Worksheet

Excel includes the powerful INDIRECT function which can be used to assemble references to other cells in your workbook. ...

Discover More

Exact Formula Copies

When you copy a formula from one cell to another, Excel normally adjusts the cell references within the formula so they ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four minus 3?

2020-01-28 08:24:57

Jennifer Thomas

If you don't need to actually print the information, you could select the desired date range and then just add 'Minimum' and 'Maximum' to the status bar (right click it and then click to check those items). Just sayin' because I've gone through the pain of creating these complex formulas and then decided to 'check my results' with the status bar values, only to realize I could have just done that in the first place. Doh!


2015-03-24 05:49:31

Girijesh Dubey

Really so useful..


2014-11-17 16:22:04

Bigger Don

@Neil et al

There is a simpler way, using an array Max(If()) and Min(If()) formulas.

I'll give the do-this/do that.

1. Build your data like described above, column A for dates and column B for Values (It works the other way around, too.)
2. Pick a cell for your date input. I used G1.
3. In H1 I put the min-since array formula: =MIN(IF(A1:A34>G1,B1:B34)), and H2 the max-since formula: =MAX(IF(A1:A34>G1,B1:B34))
!!! NOTE: Because these are array formulas instead of clicking ENTER alone, hold down the Control and Shift keys while clicking Enter.
4. Now for the most recent date when this high or low occurred.
In I1 "=MAX(IF(B1:B34=H1,A1:A34))" (no quotes) and CTRL-Shift-Enter again
In I2 "=MAX(IF(B1:B34=H2,A1:A34))" (no quotes) and CTRL-Shift-Enter again.

You now have the low and high since a point in time plus the date when each occurred.


2014-11-17 14:40:00

Neil

Seems like a lot of trouble to go to...I would just highlight the date I was interested in and then sort by the value of whatever metric you are concerned about. The row above (or below, depending on how you sort) the highlighted one would be the date with the next highest or lowest value.


2014-11-17 05:19:16

Lars

Correction.

"It only makes a notation in column C if the value in column B is greater than the maximum or less than the minimum of all the foregoing values in column B."
If that is true, then it is not the lowest/highest since that date. It is the lowest/highest ever!


2014-11-17 05:17:16

Lars

"It only makes a notation in column C if the value in column B is greater than the maximum or less than the minimum of all the foregoing values in column B."
If that is true, then it is not the lowest/highest since that date. It is the lowest ever!


2014-11-15 20:33:53

Kevin

Or Conditional formatting could be used with a helper column.
Assuming dates are in column A and numbers in column B and our control date is at E1
Add formula to helper column C. At C1 =IF(A1>$E$1,B1,"") and copy down (20 rows in example).
Conditionally format B1:B20 using “Use formula to determine which cells to format” with the formula =IF(IF(A1>$E$1,B1,"")=MAX($C$1:$C$20),MAX($C$1:$C$20),"")
And another rule with =IF(IF(A1>$E$1,B1,"")=MIN($C$1:$C$20),MIN($C$1:$C$20),"")
This method requires E1 to be the date less than the since date


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.