Michael has some data in two columns of a worksheet. Column A is a series of dates and column B contains expenditures for each of those dates. He needs a way to determine the date on which the minimum expenditure occurred and a way to find the date on which the maximum expenditure occurred.
At first glance you might be tempted to think you could use VLOOKUP to figure out the desired date. Unfortunately, that won't work because VLOOKUP keys off of whatever data is in the first column of your data table. Since you want to key off of the amount (looking for the minimum and maximum), you would need to switch the position of the columns, so that column A contained the amount and column B contained the dates. If you do that, you could then use the following formulas to find the dates for the minimum and maximum expenditures, respectively:
=VLOOKUP(MIN(A:A),A:B,2,0) =VLOOKUP(MAX(A:A),A:B,2,0)
If you cannot change the data columns, then you'll need to forego VLOOKUP and use a different approach, instead. The following two formulas will work with the data as originally specified by Michael:
=INDEX(A:A,MATCH(MIN(B:B),B:B,0)) =INDEX(A:A,MATCH(MAX(B:B),B:B,0))
It is important to note that if there are duplicates of the maximum and/or minimum expenditures, these formulas will only find the dates of the first occurrences. If this is not expected to happen often, a formula such as this could be used to alert the user to the existence of duplicates:
=IF(COUNTIF(B:B, MAX(B:B))>1, "Multiple Maximums ", INDEX(A:A, MATCH(MAX(B:B), B:B, 0)))
To make this formula work for minimums, just replace the two instances of MAX with MIN and change the word "Maximums" to "Minimums."
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9662) 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: Finding the Dates for Minimums and Maximums.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
Want to add an ordinal suffix to a number, as in 2nd, 3rd, or 4th? Excel doesn't provide a way to do it automatically, ...
Discover MoreExcel works very well with dates and times. One thing you cannot do, however, is to create a custom format that displays ...
Discover MoreWant to push a date to some pre-defined day of the month? Here are some ways to force the issue.
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-01-18 11:06:48
Bear Claw
Fine but I need the formula when the Max/Min may ocure on any one month of the year when each month has it's own sheet. I need the date as may be true for the entire year. So now what do I do?
John "Bear Claw"
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2021 Sharon Parq Associates, Inc.
Comments