How to calculate % change and then the average from individual cells

raul8

New Member
Joined
Sep 21, 2021
Messages
36
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
  2. Web
Hello again community!! I have yet another eye turning calculation to make which i need help with.
In the past i got help to construct this formula: SUM(SUMIFS(H2:H18,B2:B18,{"*Hold*","*P5*","*P6*"},M2:M18,"*BP*",H2:H18,">0"))/SUM(SUMIFS(G2:G18,B2:B18,{"*Hold*","*P5*","*P6*"},M2:M18,"*BP*",G2:G18,">0"))-1 which using the sample data below it returns a value of 0.038851 but the expected return should be 0.546164. The formula works right given its parameters but i misunderstood the parameters. So here is what the formula should calculate:

In a sheet with 90 rows, the formula needs to first filter the data set to select the rows that meet the criteria from column B (if they contain 'Hold', 'P5', 'P6') and the criteria from column M (if they contain 'BP'), then calculate the % change btwn 2 numbers [(Column H / Colum G)-1] on each row and then calculate the average of the %s that are >0. To better represent the ask, on the data set below, i added column I as a helper column. So on this sample the final # to return should be the average of the rows highlighted in yellow because their calculated % are >0, all others need to be ignored.
Book1
ABCDEFGHIJKLM
1IDBoard ColumnTitleAssigned ToPriorityDelivery DOriginal Expected CostExpected Total CostHelper ColumnHealthWork Item TStateArea Path
277864Holdx2 - Highx1500002280000.52GreenENewManagement\BP
399698P3-x3 - Mediumx1130001130000GreenEActiveManagement\BP
471321P4-x3 - Mediumx58000580000GreenEActiveManagement\BP
5106537P5-x2 - Highx5500049000-0.10909GreenEActiveManagement\BP
699730P5-x1 - Criticalx8000008000000GreenEActiveManagement\BP
778140P5-x1 - Criticalx1590002500000.572327GreenEActiveManagement\BP
8114022P5-x4 - Lowx1434801434800GreenEActiveManagement\BP
9100849P5-x3 - Mediumx66000660000GreenEActiveManagement\BP
1068387P5-x2 - Highx1250001250000YellowEActiveManagement\BP
11106256P5-x3 - Mediumx1200001200000GreenEActiveManagement\BP
12108583P5-x3 - Mediumx1630001630000GreenEActiveManagement\PK
13100802P5-x2 - Highx2180002180000GreenEActiveManagement\PK
14106791P5-x2 - Highx9500009500000YellowEActiveManagement\BP
1599277P5-x2 - Highx130000013000000GreenEActiveManagement\BP
1694233P5-x3 - Mediumx1250001250000GreenEActiveManagement\BP
1755611P6-x3 - Mediumx72000720000GreenEActiveManagement\BP
1878728P6-x2 - Highx1300001300000YellowEActiveManagement\BP
19
200.546164
21#VALUE!
Sheet1
Cell Formulas
RangeFormula
I2:I18I2=(H2/G2)-1
I20I20=AVERAGE(I2,I7)
I21I21=AVERAGE(I2:I18,">0")
 
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
To help you better understand my solution and Power Query

Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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