I have attached a very simple spreadsheet to show what I am trying to achieve.
I have a sheet with traffic-light conditions: g (green), a (amber) and r (red). So, for instance, I have a row with the following traffic-lights:
a g r a g
Now I want to do some calculations with these traffic-light conditions so I create a v-lookup table:
g 5
a 4
r 0
This would mean that the row would now read:
4 5 0 4 5
So far so good. Now I want the average of this row. Usually this is easy, I just do a =AVERAGE(A1:E1) which would give me a result of 3.6. But because there a not actual values but text values which are translated by a vlookup So I would need to do a
=AVERAGE(VLOOKUP(A1;H1:I3;2;FALSE);VLOOKUP(B1;H1:I3;2;FALSE);VLOOKUP(C1;H1:I3;2;FALSE);VLOOKUP(D1;H1:I3;2;FALSE);VLOOKUP(E1;H1:I3;2;FALSE)) which gives me the expected result of 3.6. Although this works it quickly becomes rather messy when I have thousands of rows that contain hundreds of traffic-light conditions for each row.
So, and here is my question, why can't I specify a range. So something like:
AVERAGE(VLOOKUP(A2;H1:I3;2;FALSE);VLOOKUP(E2;H1:I3;2;FALSE)). If I try this I get an error. So, what can I do? Or is there another way to achieve this?
Bookmarks