Finding the biggest gap

Tigerexcel

Active Member
Joined
Mar 6, 2020
Messages
493
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Looking for a function/formula to work out the largest difference between successive years. Column H illustrates what the result should be.
As a follow-up, how would the formula need to change if the original data wasn't sequenced eg Sam 1945 1968 1930 1990.


Book6
ABCDEFGH
2Year 1Year 2Year 3Year 4Year 5Year 6Biggest difference
3Sam193019451968199023
4Jack19501976201034
5Tom19031947195319771985202044
Sheet4
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Like this? In 2016 you may need to confirm with Ctrl+Shift+Enter


20 10 25.xlsm
ABCDEFGH
1
2Year 1Year 2Year 3Year 4Year 5Year 6Biggest difference
3Sam193019451968199023
4Jack19501976201034
5Tom19031947195319771985202044
Max gap
Cell Formulas
RangeFormula
H3:H5H3=MAX(C3:G3-B3:F3)


Another option where C+S+E shouldn't be required would be
Excel Formula:
=AGGREGATE(14,6,C3:G3-B3:F3,1)
 
Upvote 0
A follow-up question, how would you modify the formula to find the 2nd or 3rd biggest deficit? Eg, for Sam it would be 22 if we're after the 2nd biggest deficit. I tried the Large function but couldn't get it to give me the right answer.
 
Upvote 0
Use the AGGREGATE function that I posted but change the final argument to 2 for 2nd largest, 3 for 3rd largest etc
 
Upvote 0
One last question, is it possible that the formula can provide which of the numbers return the Max? For example, it would return 1968 and 1945.
 
Upvote 0
One last question, is it possible that the formula can provide which of the numbers return the Max? For example, it would return 1968 and 1945.
The formulae to pick up these values can be in cells separate to what the actual gap is.
 
Upvote 0
provide which of the numbers return the Max?
What if there were 2 (or more) pairs of numbers giving equal maximum gap?

Also, can you post sample data and expected results so we can see how and where you want the result(s) shown?
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,954
Members
448,535
Latest member
alrossman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top