Percentage from last two filled columns

RSnap3232

New Member
Joined
Nov 20, 2020
Messages
43
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
hello All,

I have a spreadsheet which gets updated with weekly (columns) data for certain subjects (rows), I need to know the percentage for the last two weeks/ columns that have been filled in (as not all subjects will have the same columns filled up), is there a way round this?

example;

1615301925165.png
 

Attachments

  • 1615301842065.png
    1615301842065.png
    18.9 KB · Views: 2

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
How about this?

Book1 (version 2).xlsb
ABCDEFGHIJ
2subjectweek 1week 2week 3week 4week 5week 6week 7% Difference
3Movemnets300312289301333312310-0.64%
4distance21022198210022232123210022899.00%
5accidents6652350.00%
6issues22442-50.00%
Sheet7
Cell Formulas
RangeFormula
J3:J6J3=(INDEX(B3:I3,COUNT(B3:I3))-INDEX(B3:I3,COUNT(B3:I3)-1))/INDEX(B3:I3,COUNT(B3:I3)-1)
 
Upvote 0
Solution
How about this?

Book1 (version 2).xlsb
ABCDEFGHIJ
2subjectweek 1week 2week 3week 4week 5week 6week 7% Difference
3Movemnets300312289301333312310-0.64%
4distance21022198210022232123210022899.00%
5accidents6652350.00%
6issues22442-50.00%
Sheet7
Cell Formulas
RangeFormula
J3:J6J3=(INDEX(B3:I3,COUNT(B3:I3))-INDEX(B3:I3,COUNT(B3:I3)-1))/INDEX(B3:I3,COUNT(B3:I3)-1)
sorry it looks like when the first number is a zero or both numbers in the columns are a zero is spits out #DIV/0! any ideas to why?
 
Upvote 0
Because the formula for percentage difference is (NewValue-OldValue)/OldValue, and you can't divide by zero. So if the old value is zero you will get the #DIV/0 error. You can wrap the formula with the IFERROR function to give it a default value if there is an error.
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

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