How to manage data data outside a table?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,691
Office Version
  1. 365
Platform
  1. Windows
The mini-sheet below contains a table with sample ratings for several "products". I'm working on an algorithm for calculating a weighted average rating based on a number of proerties. In this example, the properties are ratings from 3 different sources (Rtg 1, Rtg2, and Rtg 3). Rows 4 & 5 above the table, contain the maximum and minimum values for each rating. These allow me to calculate the normalized ratings. Is there a good way to keep these values in the right columns if I insert a column somewhere.

Weighted Ratings.xlsx
CDEFGHIJKLMNOP
4Max Value510100
5Min Value100
6Weight111
7
8Item0-1 Sum0-1 RankZ SumZ RankRtg 10-1 1Z 1Rtg 20-1 2Z 2Rtg 30-1 3Z 3
9A1.742-0.2644.80.951.3770.7-0.61790.79-1.02
10D1.7431.2914.10.78-1.1590.90.92960.961.53
11E1.694-1.8154.50.880.2960.6-1.38810.81-0.72
12B1.6550.0134.20.80-0.7990.90.92850.85-0.12
13C1.7610.7724.50.880.2980.80.15880.880.33
14Std Dev0.281.306.69
15Mean4.427.8085.80
Z Scores
Cell Formulas
RangeFormula
D9:D13D9=[@[0-1 1]]+[@[0-1 3]]
E9:E13E9=RANK.AVG([@[0-1 Sum]],[0-1 Sum])
F9:F13F9=[@[Z 1]]+[@[Z 2]]+[@[Z 3]]
G9:G13G9=RANK.AVG([@[Z Sum]],[Z Sum])
I9:I13I9=([@[Rtg 1]]-H$5)/(H$4-H$5)
J9:J13J9=([@[Rtg 1]]-H$15)/Table2[[#Totals],[Rtg 1]]
L9:L13L9=([@[Rtg 2]]-K$5)/(K$4-K$5)
M9:M13M9=([@[Rtg 2]]-K$15)/Table2[[#Totals],[Rtg 2]]
O9:O13O9=([@[Rtg 3]]-N$5)/(N$4-N$5)
P9:P13P9=([@[Rtg 3]]-N$15)/Table2[[#Totals],[Rtg 3]]
H14H14=SUBTOTAL(107,[Rtg 1])
H15H15=AVERAGE(Table2[Rtg 1])
K14K14=SUBTOTAL(107,[Rtg 2])
K15K15=AVERAGE(Table2[Rtg 2])
N14N14=SUBTOTAL(107,[Rtg 3])
N15N15=AVERAGE(Table2[Rtg 3])


Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Perhaps I should have chosen a better title. What I am trying to do it connect some data outside a table with corresponding data inside the table. Here's a better example than the one above. This table contains a list of password managers. For each one, I have columns for the date, the product name, the rating, the price, and columns for ratings by 4 different companies. There are several more to add, plus I want to add columns for features that I care about. The Rating column will be a call to the UDF I am writing. It will examine the entire table and calculate an overall rating. I am happy to discuss the algorithm in another thread if anyone is interested.

Above the table in yellow, are 2 rows with information that the algorithm needs to do its work. The Weights row tells the algorithm how much (relative) weight to give to each data column. The Codes row tells the algorithm what kind of data is in that column. For example, the CyberNews column has 5 star ratings; the PC Mag column has ranked the products from 1 to 10.

Password Managers.xlsx
BCDEFGHI
2Weights11.51.20.81.6
3Codes$5-11-101-31-13
4DateProductRatingPrice (1 year)CyberNewsPC MagWiredTom's Guide
59/22/22 1Password$364.0512
69/22/22 Avira$323.8
79/23/22 Bitwarden$60315
89/23/22 Blur9
99/22/22 Dashlane$604.2914
109/22/22 Enpass$243.7311
119/23/22 KeePass10
129/22/22 Keeper$354.6133
139/22/22 LastPass$363.9431
149/23/22 LogMeOnce$396
159/23/22 Myki$487
169/22/22 Nordpass$364.91026
179/22/22 Norton$853.9
189/22/22 PassWarden$404.0
199/23/22 Password Boss??8
209/22/22 Roboform$144.4738
219/23/22 True Key13
229/23/22 Zoho$54212
Sheet1


I have 2 problems:
  1. If I am not careful when inserting, deleting, or moving table columns, the codes above may not stay connected.
  2. I can pass the entire table to the UDF using the table name and that range will expand or contract as data is added or deleted. But how to pass the location of the 2 code rows aboive the table? Can the UDF query the absolute address of each cell in the table and then use the offset function to get to the code data above?
Let me know if I haven't explained this well enough or if there are any questions.

Thanks for any help.
 
Upvote 0
I'd suggest putting that data into its own lookup table.

I'm not sure what you mean by "lookup table". It must not be a "table" table. I just tried selecting those 2 rows and clicking on Format as Table. With two tables in the same columns, Excel will not allow me to insert columns from the column letter. And if I do it from the table column, it inly affects that table.

If it is not a table table, then how do I name it so I can pass it to the UDF? Table names expand with the table. Not so with named ranges. I have named the cells before and after the range and then defined a named range using offset, but this does not guarantee that the columns will remain "connected" (lined up) with thedata in the main table.

Thanks
 
Upvote 0
I mean a three column table located elsewhere. First column is the name of the column to which it applies, second column is the Weight and third column is the Code.
 
Upvote 0
I mean a three column table located elsewhere. First column is the name of the column to which it applies, second column is the Weight and third column is the Code.
I see. I think this is more of a hassle than just putting it where it is and being careful. Having it lined up with the corresponding values makes it easy to see and manage. The only options for "elsewhere" are (a) a different sheet and (b) different columns in the same sheet (way off to the right). Neither has the clear visual alignment.

I guess I'll use my usual offset naming scheme and be careful. I might replicate the table headers so I can more easily tell if something gets out of whack.

Password Managers.xlsx
BCDEFGHI
2Price (1 year)CyberNewsPC MagWiredTom's Guide
3Weights11.51.20.81.6
4Codes$5-11-101-31-5
5
6DateProductRatingPrice (1 year)CyberNewsPC MagWiredTom's Guide
79/22/22 1Password$364.0512
89/22/22 Avira$323.8
99/23/22 Bitwarden$60315
109/23/22 Blur9
119/22/22 Dashlane$604.2914
129/22/22 Enpass$243.7311
139/23/22 KeePass10
149/22/22 Keeper$354.6133
159/22/22 LastPass$363.9431
169/23/22 LogMeOnce$396
179/23/22 Myki$487
189/22/22 Nordpass$364.91026
199/22/22 Norton$853.9
209/22/22 PassWarden$404.0
219/23/22 Password Boss??8
229/22/22 Roboform$144.4738
239/23/22 True Key13
249/23/22 Zoho$54212
Sheet1


I should probably move this application to a database.

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,222
Members
453,024
Latest member
Wingit77

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