Product function with exponents

Bgreen83

New Member
Joined
Oct 3, 2019
Messages
6
Hello,
I'm trying to use the PRODUCT function to accurately rollup locations to a region level for each weighted geometric mean. The cells highlighted in yellow are zero values. I have not included those cells in the region rollup (blue cells). If I include those cells in my current calculations, I receive #NULL or zero. Is there are way to include those cells and still receive the correct values that are currently displayed?



GMLOS Calculation.xlsx
ABCDEFGHIJ
4LocationMetricDetailMonthYearYear2ActualTotal CasesGMLOS O/EGMLOS
5Location AAcute LOS OEPremier SourceJanuary2022 Jan-22Actual2420.762.81
6Location BAcute LOS OEPremier SourceJanuary2022 Jan-22Actual3530.773.22
7Location CAcute LOS OEPremier SourceJanuary2022 Jan-22Actual410.843.10
8Region AAcute LOS OEPremier SourceJanuary2022 Jan-22Actual1.32695826534905E-730.77
9Location DAcute LOS OEPremier SourceJanuary2022 Jan-22Actual2941.083.67
10Location EAcute LOS OEPremier SourceJanuary2022 Jan-22Actual61.514.24
11Location FAcute LOS OEPremier SourceJanuary2022 Jan-22Actual0--
12Region BAcute LOS OEPremier SourceJanuary2022 Jan-22Actual33187502300.86761.08
13Location GAcute LOS OEPremier SourceJanuary2022 Jan-22Actual0--
14Location HAcute LOS OEPremier SourceJanuary2022 Jan-22Actual3320.943.86
15Location IAcute LOS OEPremier SourceJanuary2022 Jan-22Actual5281.194.49
16Location JAcute LOS OEPremier SourceJanuary2022 Jan-22Actual2070.843.25
17Region CAcute LOS OEPremier SourceJanuary2022 Jan-22Actual28910163178653201.03
GMLOS
Cell Formulas
RangeFormula
H5:H7,H9:H11,H13:H16H5=SUMIFS(Query1!$C:$C,Query1!$H:$H,VLOOKUP($A5,LOOKUPS!$B$2:$C$31,COLUMNS(LOOKUPS!$B$2:$C$2),0),Query1!$A:$A,VLOOKUP($F5,LOOKUPS!$Q$2:$R$40,COLUMNS(LOOKUPS!$Q$2:$R$2),0))
I5:I7,I9:I11,I13:I16I5=SUMIFS(Query1!$J:$J,Query1!$H:$H,VLOOKUP($A5,LOOKUPS!$B$2:$C$31,COLUMNS(LOOKUPS!$B$2:$C$2),0),Query1!$A:$A,VLOOKUP($F5,LOOKUPS!$Q$2:$R$40,COLUMNS(LOOKUPS!$Q$2:$R$2),0))
J5:J7,J9:J11,J13:J16J5=SUMIFS(Query1!$K:$K,Query1!$H:$H,VLOOKUP($A5,LOOKUPS!$B$2:$C$31,COLUMNS(LOOKUPS!$B$2:$C$2),0),Query1!$A:$A,VLOOKUP($F5,LOOKUPS!$Q$2:$R$40,COLUMNS(LOOKUPS!$Q$2:$R$2),0))
H8,H17H8=TRIM(PRODUCT($I5^$H5,$I6^$H6,$I7^$H7))
I8,I12,I17I8=H8^(1/SUM($H5:$H7))
H12H12=TRIM(PRODUCT($I9^$H9,$I10^$H10))
J12,J17J12=IFERROR(SUM(L12/N12),"")
Named Ranges
NameRefers ToCells
Query1!ExternalData_1=Query1!$A$1:$H$687H13:J16, H9:J11, H5:J7
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Your formulas are long ones. I put a simple approach to what I think might help. Basically, if the formula encounters a zero, it makes it a one but then doesn't consider the zero as part of the nth root for the geometric mean.
MrExcelPlayground10.xlsx
ABCDE
154.47213654.472136
244
304
445
55
Sheet7
Cell Formulas
RangeFormula
B1B1=PRODUCT(IF(A1:A5<>0,A1:A5,1))^(1/COUNTIF(A1:A5,"<>0"))
E1E1=PRODUCT(IF(D1:D4<>0,D1:D4,1))^(1/COUNTIF(D1:D4,"<>0"))
 
Upvote 0
Thank you for your response! I guess I'm not sure how I would use your simple approach in my example above. For instance, in cell H12, I'm taking cell I9 and raising (^) that to cell H9.

In cell H12 I'm using this formula =TRIM(PRODUCT($I9^$H9,$I10^$H10)) but didn't include the cells in yellow (i11 & H11) because they're both zero. Cell H12 (Region B) is the rollup for Locations D, E & F.
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,429
Members
448,961
Latest member
nzskater

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