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 |
---|
|
---|
| B | C | D | E | F | G | H | I |
---|
2 | | | Weights | 1 | 1.5 | 1.2 | 0.8 | 1.6 |
---|
3 | | | Codes | $ | 5-1 | 1-10 | 1-3 | 1-13 |
---|
4 | Date | Product | Rating | Price (1 year) | CyberNews | PC Mag | Wired | Tom's Guide |
---|
5 | 9/22/22 | 1Password | | $36 | 4.0 | 5 | 1 | 2 |
---|
6 | 9/22/22 | Avira | | $32 | 3.8 | | | |
---|
7 | 9/23/22 | Bitwarden | | $60 | | 3 | 1 | 5 |
---|
8 | 9/23/22 | Blur | | | | | | 9 |
---|
9 | 9/22/22 | Dashlane | | $60 | 4.2 | 9 | 1 | 4 |
---|
10 | 9/22/22 | Enpass | | $24 | 3.7 | | 3 | 11 |
---|
11 | 9/23/22 | KeePass | | | | | | 10 |
---|
12 | 9/22/22 | Keeper | | $35 | 4.6 | 1 | 3 | 3 |
---|
13 | 9/22/22 | LastPass | | $36 | 3.9 | 4 | 3 | 1 |
---|
14 | 9/23/22 | LogMeOnce | | $39 | | 6 | | |
---|
15 | 9/23/22 | Myki | | $48 | | | | 7 |
---|
16 | 9/22/22 | Nordpass | | $36 | 4.9 | 10 | 2 | 6 |
---|
17 | 9/22/22 | Norton | | $85 | 3.9 | | | |
---|
18 | 9/22/22 | PassWarden | | $40 | 4.0 | | | |
---|
19 | 9/23/22 | Password Boss | | ?? | | 8 | | |
---|
20 | 9/22/22 | Roboform | | $14 | 4.4 | 7 | 3 | 8 |
---|
21 | 9/23/22 | True Key | | | | | | 13 |
---|
22 | 9/23/22 | Zoho | | $54 | | 2 | | 12 |
---|
|
---|
I have 2 problems:
- If I am not careful when inserting, deleting, or moving table columns, the codes above may not stay connected.
- 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.