I could use help with a bit of a complex table addressing problem

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,687
Office Version
  1. 365
Platform
  1. Windows
The minisheet below has a table that has some addressing problems.
  • Column C has the names of some "products".
  • Column D has what I am calling "composite ratings". They are the results of calculations done in the rest of the table.
  • Columns E, N, and W are divider columns for illustration purposes only.
  • Columns F-M contain ratings from various sources (R1 to R8).
    • R1 & R2 are 5-star ratings.
    • R3 is a 0-10 rating.
    • R4 is some sort of numerical rating.
    • R5 & R8 are rankings (1, 2, 3, ...).
    • R6 & R7 are another sort of numerical rating.
  • The numbers above these columns in row 3 (F3:M3), contain relative weights to be assigned to these ratings.
  • The text above these columns in row 2 (F2:M2), show whether the top ratings are the largest numbers (HiLo) or the smallest numbers (LoHi). This affects how the Z Scores are calculated.
  • Columns O-V contain Z Scores of the values in Columns F-M. This is done by my ZScore UDF. This is where one of the addressing problems exists.
  • Column X is the sum of the Z Scores with the weights applied. This is the other addressing problem.
All those absolute (or semi-absolute (F$14)) addresses are a problem. If I need to add, delete, or reorder any of the rating columns, I have to make sure that the helper rows above the table and the Z Score columns stay aligned.

One solution would be to move the helper rows inside the table (at the top). But that is a problem if I want to sort the table on the composite ratings.

Another solution is move the Z-Score columns and the Z Sum column to a UDF. Then I only have to keep the helper rows in sync, which is much easier. That is my current plan, but before I do that, I thought I would check here to see if there is a better way. And even if I do that, how best to keep those helper rows in sync.

And then there is the table shortcoming of only allowing 1 total row. I need both the mean and the std dev. One of them has to be outside the table and not accessible with table syntax. I suppose I could use Offset to get from the mean to the std dev. And then I could use Offset to get from the headers to the helper rows. I think I'll try that next.

I'd appreciate any other suggestions.

Thanks

Access Tutorial Ratings.xlsx
CDEFGHIJKLMNOPQRSTUVWX
2OrderHiLoHiLoHiLoHiLoLoHiHiLoHiLoLoHi
3Weight22211111
4ProductComposite Rating (0-100)P StartR1R2R3R4R5R6R7R8Z StartZ R1Z R2Z R3Z R4Z R5Z R6Z R7Z R8Z EndZ Sum
5A1004.44.69.1638.91436.163.92+0.08+0.20+1.41+0.03+0.13+0.21+1.56+0.79+6.09
6B894.64.79.012+1.29+0.98+0.71    -1.51+4.44
7C774.44.68.81039.46255.647.11+0.08+0.20-0.71+0.94+0.64+1.78-0.95+1.02+2.55
8D594.54.68.8429.83526.456.04+0.69+0.20-0.71-0.44-0.13-0.57+0.38+0.33-0.08
9E574.54.79.0109.951231.249.411+0.69+0.98+0.71-1.17-1.91-0.18-0.61-1.28-0.41
10F514.44.68.7807.65333.050.93+0.08+0.20-1.41+0.42+0.38-0.04-0.38+0.56-1.35
11G454.24.58.91240.37118.65-1.14-0.59=0.00+1.40+0.89-1.20 +0.10-2.26
12H04.14.3100.63-1.75-2.15 -1.19    -8.98
13Averages59.64.44.68.9623.84.533.553.55.40.00.00.00.00.00.00.00.00.0
14Std Devs30.830.160.130.14440.143.9412.436.694.351.001.001.001.001.001.001.001.004.65
15Max+6.09
16Min-8.98
Mr Excel
Cell Formulas
RangeFormula
O5:O12O5=ZScore([@R1],Table13[[#Totals],[R1]],F$14,F$2)
P5:P12P5=ZScore([@R2],Table13[[#Totals],[R2]],G$14,G$2)
Q5:Q12Q5=ZScore([@R3],Table13[[#Totals],[R3]],H$14,H$2)
R5:R12R5=ZScore([@R4],Table13[[#Totals],[R4]],I$14,I$2)
S5:S12S5=ZScore([@R5],Table13[[#Totals],[R5]],J$14,J$2)
T5:T12T5=ZScore([@R6],Table13[[#Totals],[R6]],K$14,K$2)
U5:U12U5=ZScore([@R7],Table13[[#Totals],[R7]],L$14,L$2)
V5:V12V5=ZScore([@R8],Table13[[#Totals],[R8]],M$14,M$2)
O13O13=SUBTOTAL(101,[Z R1])
P13P13=SUBTOTAL(101,[Z R2])
Q13Q13=SUBTOTAL(101,[Z R3])
R13R13=SUBTOTAL(101,[Z R4])
S13S13=SUBTOTAL(101,[Z R5])
T13T13=SUBTOTAL(101,[Z R6])
U13U13=SUBTOTAL(101,[Z R7])
V13V13=SUBTOTAL(101,[Z R8])
O14O14=STDEV.S(Table13[Z R1])
P14P14=STDEV.S(Table13[Z R2])
Q14Q14=STDEV.S(Table13[Z R3])
R14R14=STDEV.S(Table13[Z R4])
S14S14=STDEV.S(Table13[Z R5])
T14T14=STDEV.S(Table13[Z R6])
U14U14=STDEV.S(Table13[Z R7])
V14V14=STDEV.S(Table13[Z R8])
F13F13=SUBTOTAL(101,[R1])
G13G13=SUBTOTAL(101,[R2])
H13H13=SUBTOTAL(101,[R3])
I13I13=SUBTOTAL(101,[R4])
J13J13=SUBTOTAL(101,[R5])
K13K13=SUBTOTAL(101,[R6])
L13L13=SUBTOTAL(101,[R7])
M13M13=SUBTOTAL(101,[R8])
F14F14=STDEV.S(Table13[R1])
G14G14=STDEV.S(Table13[R2])
H14H14=STDEV.S(Table13[R3])
I14I14=STDEV.S(Table13[R4])
J14J14=STDEV.S(Table13[R5])
K14K14=STDEV.S(Table13[R6])
L14L14=STDEV.S(Table13[R7])
M14M14=STDEV.S(Table13[R8])
D5:D12D5=ScaleRatings([@[Z Sum]],ZSumMax,ZSumMin)
D13D13=SUBTOTAL(101,[Composite Rating (0-100)])
D14D14=STDEV.S(Table13[Composite Rating (0-100)])
X5:X12X5=SUMPRODUCT(Table13[@[Z R1]:[Z R8]],F$3:M$3)
X13X13=SUBTOTAL(101,[Z Sum])
X14X14=STDEV.S(Table13[Z Sum])
X15X15=MAX(Table13[Z Sum])
X16X16=MIN(Table13[Z Sum])
Named Ranges
NameRefers ToCells
'Mr Excel'!ZSumMax='Mr Excel'!$X$15D5:D12
'Mr Excel'!ZSumMin='Mr Excel'!$X$16D5:D12
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I took my own suggestions. I used Offset addressing to get to the std dev's and the Orders (HiLo/LoHi). I then assigned a name to the range of weights, also using offset addressing.

It seems to work.

Comments?

Access Tutorial Ratings.xlsx
CDEFGHIJKLMNOPQRSTUVWX
2OrderHiLoHiLoHiLoHiLoLoHiHiLoHiLoLoHi
3Weight22211111
4ProductComposite Rating (0-100)P StartR1R2R3R4R5R6R7R8Z StartZ R1Z R2Z R3Z R4Z R5Z R6Z R7Z R8Z EndZ Sum
5A1004.44.69.1638.91436.163.92+0.08+0.20+1.41+0.03+0.13+0.21+1.56+0.79+6.09
6B894.64.79.012+1.29+0.98+0.71    -1.51+4.44
7C774.44.68.81039.46255.647.11+0.08+0.20-0.71+0.94+0.64+1.78-0.95+1.02+2.55
8D594.54.68.8429.83526.456.04+0.69+0.20-0.71-0.44-0.13-0.57+0.38+0.33-0.08
9E574.54.79.0109.951231.249.411+0.69+0.98+0.71-1.17-1.91-0.18-0.61-1.28-0.41
10F514.44.68.7807.65333.050.93+0.08+0.20-1.41+0.42+0.38-0.04-0.38+0.56-1.35
11G454.24.58.91240.37118.65-1.14-0.59=0.00+1.40+0.89-1.20 +0.10-2.26
12H04.14.3100.63-1.75-2.15 -1.19    -8.98
13Averages59.64.44.68.9623.84.533.553.55.40.00.00.00.00.00.00.00.00.0
14Std Devs30.830.160.130.14440.143.9412.436.694.351.001.001.001.001.001.001.001.004.65
15Max+6.09
16Min-8.98
Mr Excel
Cell Formulas
RangeFormula
O5:O12O5=ZScore([@R1],Table13[[#Totals],[R1]],OFFSET(Table13[[#Totals],[R1]],1,0),OFFSET(Table13[[#Headers],[R1]],-2,0))
P5:P12P5=ZScore([@R2],Table13[[#Totals],[R2]],OFFSET(Table13[[#Totals],[R2]],1,0),OFFSET(Table13[[#Headers],[R2]],-2,0))
Q5:Q12Q5=ZScore([@R3],Table13[[#Totals],[R3]],OFFSET(Table13[[#Totals],[R3]],1,0),OFFSET(Table13[[#Headers],[R3]],-2,0))
R5:R12R5=ZScore([@R4],Table13[[#Totals],[R4]],OFFSET(Table13[[#Totals],[R4]],1,0),OFFSET(Table13[[#Headers],[R4]],-2,0))
S5:S12S5=ZScore([@R5],Table13[[#Totals],[R5]],OFFSET(Table13[[#Totals],[R5]],1,0),OFFSET(Table13[[#Headers],[R5]],-2,0))
T5:T12T5=ZScore([@R6],Table13[[#Totals],[R6]],OFFSET(Table13[[#Totals],[R6]],1,0),OFFSET(Table13[[#Headers],[R6]],-2,0))
U5:U12U5=ZScore([@R7],Table13[[#Totals],[R7]],OFFSET(Table13[[#Totals],[R7]],1,0),OFFSET(Table13[[#Headers],[R7]],-2,0))
V5:V12V5=ZScore([@R8],Table13[[#Totals],[R8]],OFFSET(Table13[[#Totals],[R8]],1,0),OFFSET(Table13[[#Headers],[R8]],-2,0))
O13O13=SUBTOTAL(101,[Z R1])
P13P13=SUBTOTAL(101,[Z R2])
Q13Q13=SUBTOTAL(101,[Z R3])
R13R13=SUBTOTAL(101,[Z R4])
S13S13=SUBTOTAL(101,[Z R5])
T13T13=SUBTOTAL(101,[Z R6])
U13U13=SUBTOTAL(101,[Z R7])
V13V13=SUBTOTAL(101,[Z R8])
O14O14=STDEV.S(Table13[Z R1])
P14P14=STDEV.S(Table13[Z R2])
Q14Q14=STDEV.S(Table13[Z R3])
R14R14=STDEV.S(Table13[Z R4])
S14S14=STDEV.S(Table13[Z R5])
T14T14=STDEV.S(Table13[Z R6])
U14U14=STDEV.S(Table13[Z R7])
V14V14=STDEV.S(Table13[Z R8])
F13F13=SUBTOTAL(101,[R1])
G13G13=SUBTOTAL(101,[R2])
H13H13=SUBTOTAL(101,[R3])
I13I13=SUBTOTAL(101,[R4])
J13J13=SUBTOTAL(101,[R5])
K13K13=SUBTOTAL(101,[R6])
L13L13=SUBTOTAL(101,[R7])
M13M13=SUBTOTAL(101,[R8])
F14F14=STDEV.S(Table13[R1])
G14G14=STDEV.S(Table13[R2])
H14H14=STDEV.S(Table13[R3])
I14I14=STDEV.S(Table13[R4])
J14J14=STDEV.S(Table13[R5])
K14K14=STDEV.S(Table13[R6])
L14L14=STDEV.S(Table13[R7])
M14M14=STDEV.S(Table13[R8])
D5:D12D5=ScaleRatings([@[Z Sum]],ZSumMax,ZSumMin)
D13D13=SUBTOTAL(101,[Composite Rating (0-100)])
D14D14=STDEV.S(Table13[Composite Rating (0-100)])
X5:X12X5=SUMPRODUCT(Table13[@[Z R1]:[Z R8]],Weights)
X13X13=SUBTOTAL(101,[Z Sum])
X14X14=STDEV.S(Table13[Z Sum])
X15X15=MAX(Table13[Z Sum])
X16X16=MIN(Table13[Z Sum])
Named Ranges
NameRefers ToCells
'Mr Excel'!Weights=OFFSET('Mr Excel'!WtBeg,0,1):OFFSET('Mr Excel'!WtEnd,0,-1)X5:X12
'Mr Excel'!WtBeg='Mr Excel'!$E$3X5:X12
'Mr Excel'!WtEnd='Mr Excel'!$N$3X5:X12
'Mr Excel'!ZSumMax='Mr Excel'!$X$15D5:D12
'Mr Excel'!ZSumMin='Mr Excel'!$X$16D5:D12
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,154
Members
452,615
Latest member
bogeys2birdies

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