Monthly balance difference - find highest variation

ChetManley

New Member
Joined
Dec 9, 2019
Messages
33
Office Version
  1. 2010
Platform
  1. Windows
Hi everyone,

I have a table with 12 columns containing monthly balances of our customers:

JanFebMarAprMayJunJulAugSepOctNovDec
103.5551905001234444.531.20900

I need to calculate the variation between consecutive months (Jan to Feb, Feb to March, so on..) and return the highest of these variations (in above example would be Nov to Dec - +900).

Even though this can be easily done, albeit with several steps - i.e. calculate the variation between each month separately by adding extra columns - and then doing a MAX on those cells.
Is there a more elegant solution here that I'm missing?
I'm open to any type of solution (VBA, formula, etc)

Much appreciated,
Chet
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi there. You can do it with an array formula like this:
Book1
ABCDEFGHIJKL
1JanFebMarAprMayJunJulAugSepOctNovDec
2103.5551905001234444.531.20900
3
4900
Sheet1
Cell Formulas
RangeFormula
D4D4{=MAX(A2:L2-B2:M2)}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
Remember that the range formula (in D2) must be entered using Ctrl-shift-enter and don't type the curly brackets.
 
Upvote 0
Solution
Hi there. You can do it with an array formula like this:
Book1
ABCDEFGHIJKL
1JanFebMarAprMayJunJulAugSepOctNovDec
2103.5551905001234444.531.20900
3
4900
Sheet1
Cell Formulas
RangeFormula
D4D4{=MAX(A2:L2-B2:M2)}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
Remember that the range formula (in D2) must be entered using Ctrl-shift-enter and don't type the curly brackets.

Hi @jmacleary ,

That's great! Only issue is it doesn't pick up negative variations!

e.g. If Feb = 100 and Mar = 900 and Apr = 1000

the formula will return March to April (+100) instead of Feb to March (-800).

Would {=MAX(ABS(A2:L2-B2:M2))} bypass this?

Cheers
Chet
 
Upvote 0
Yes it would - of course strictly speaking a positive value is always greater than a negative one! ;) However, I was a bit lax there. Be aware that you will always get a positive result
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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