Biggest change occurs in which year?

Waimea

Active Member
Joined
Jun 30, 2018
Messages
465
Office Version
  1. 365
Platform
  1. Windows
Hi, I am trying to check a table/range for what the maximum change in percent is and to get the year, ex. 2019, in which the biggest change occurs in.

I am tying to use MAX and MATCH formulas w/o success. In my dataset I have more years and more values but it seems fitting to post 3 values here.

[TABLE="width: 192"]
<tbody>[TR]
[TD="width: 64, align: right"]2017[/TD]
[TD="width: 64, align: right"]2018[/TD]
[TD="width: 64, align: right"]2019[/TD]
[/TR]
[TR]
[TD="align: right"]0,196[/TD]
[TD="align: right"]0,199[/TD]
[TD="align: right"]0,203[/TD]
[/TR]
</tbody>[/TABLE]

In the above example I would like to get the following output:

The biggest change occurs in year 2019 with 20,3...%.


Also, if possible I would like to rank the years from largest to smallest or vice versa, in my dataset I have more years and more values.

Year Rank
2017 3
2018 2
2019 1
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
In the above example I would like to get the following output:

The biggest change occurs in year 2019 with 20,3...%.
What output would you want for this sample data?


Excel 2016
ABC
1201720182019
20.2030.1990.203
Sample
 
Upvote 0
Thank you for your reply,

In my dataset there are more decimals so the possiblility of the same values ocurring are very small.

However, from your sample data I would like the following output:

"The biggest change occurs in year 2017 with 20.3% and in year 2019 with 20,3%. "

 
Upvote 0
Hi Waimea,

For the columns across I've allowed until J. You can of course change he J2 references to any value through XFD2.

The row 5 formulae are to be copied down as far as necessary.

If two percentages are the same you will see two rows with the same percentage and same ranking but the next below will skip a rank.

ABC

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2017[/TD]
[TD="align: center"]2018[/TD]
[TD="align: center"]2019[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]0.196[/TD]
[TD="align: center"]0.199[/TD]
[TD="align: center"]0.203[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]Year[/TD]
[TD="align: center"]Rank[/TD]
[TD="align: center"]Value[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]2019[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]0.203[/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]2018[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0.199[/TD]

[TD="align: center"]7[/TD]
[TD="align: center"]2017[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]0.196[/TD]

</tbody>
Sheet2

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]A5[/TH]
[TD="align: left"]=INDEX($A$1:$J$1,AGGREGATE(15,6,COLUMN($A$2:$J$2)/($A$2:$J$2=C5),COUNTIF($C5:$C$18,C5)))[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B5[/TH]
[TD="align: left"]=RANK.EQ(C5,$A$2:$J$2,0)[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C5
[/TH]
[TD="align: left"]=AGGREGATE(14,6,$A$2:$J$2,ROWS($A$4:A4))[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
See if either of these is any use. If your version of Excel does not have the TEXTJOIN function and you say you have more years than 3, then I don't think this is feasible with ordinary worksheet functions and you would need to move to a vba solution. So, if you don't have TEXTJOIN, do you want a vba suggestion?

Both these formulas are array formulas so should be entered without the {} but confirmed with Ctrl+Shift+Enter, not just Enter. If confirmed correctly, Excel will insert the {}. The formulas can then be copied down.

Excel Workbook
ABCDEF
1201720182019
20.1960.1990.203The biggest change occurs in year 2019 with 20.3%The biggest change occurs in year 2019 with 20.3%
30.0120.50.23The biggest change occurs in year 2018 with 50.0%The biggest change occurs in year 2018 with 50.0%
40.2030.1990.203The biggest change occurs in year 2017 & 2019 with 20.3%The biggest change occurs in year 2017 with 20.3% and in year 2019 with 20.3%
Biggest Change
 
Upvote 0
Thank you Peter_SSs and Toadstool for your replies!

I am going to try both approaches!

I will make a post when I have it working! :)
 
Upvote 0
I would recommend one change to Toadstool's A5 formula. Without the change, if somebody was to subsequently insert any new columns to the left of the sheet, it would then return incorrect results.

=INDEX($A$1:$J$1,AGGREGATE(15,6,(COLUMN($A$2:$J$2)-COLUMN($A2)+1)/($A$2:$J$2=C5),COUNTIF($C5:$C$18,C5)))
 
Upvote 0
Thank you again for your replies, I got both working and I think that I'll use both of your formulas! One for the percentage change and one with the ranking.

However, I get something wrong with my formatting of the percentage.

[TABLE="width: 704"]
<colgroup><col width="64" span="11" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64, align: right"]2012[/TD]
[TD="width: 64, align: right"]2013[/TD]
[TD="width: 64, align: right"]2014[/TD]
[TD="width: 64, align: right"]2015[/TD]
[TD="width: 64, align: right"]2016[/TD]
[TD="width: 64, align: right"]2017[/TD]
[TD="width: 64, align: right"]2018[/TD]
[TD="width: 64, align: right"]2019[/TD]
[TD="width: 64, align: right"]2020[/TD]
[TD="width: 64, align: right"]2021[/TD]
[TD="width: 64, align: right"]2022[/TD]
[/TR]
[TR]
[TD="class: xl131, align: right"]17,19%[/TD]
[TD="class: xl131, align: right"]17,85%[/TD]
[TD="class: xl131, align: right"]18,41%[/TD]
[TD="class: xl131, align: right"]18,88%[/TD]
[TD="class: xl131, align: right"]19,27%[/TD]
[TD="class: xl131, align: right"]19,64%[/TD]
[TD="class: xl131, align: right"]19,98%[/TD]
[TD="class: xl131, align: right"]20,33%[/TD]
[TD="class: xl131, align: right"]20,57%[/TD]
[TD="class: xl131, align: right"]20,89%[/TD]
[TD="class: xl131, align: right"]21,21%[/TD]
[/TR]
</tbody>[/TABLE]

This sample produces the following text:

"The biggest change occurs in year 2022 with 2.1%"

I want the 2,1% to be 21,21%.

What am I doing wrong?
 
Upvote 0
I got it to work, I didn't change the . to a , in the format formula.

Thank you again for your input and your help!
 
Upvote 0
I got it to work, I didn't change the . to a , in the format formula.

Thank you again for your input and your help!
Yes, I forgot to mention the different decimal indicator. Glad you figured it out anyway. :)
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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