Use one column to identify values in adjacent column.

K

Ken Fickling

I would like to average 6 sets of columns. Each set has
one descriptive and one value column. ex: A3=5 B3=12%,
C8=5 D8=21%, E14=5 F14=9%, etc. I want to ID all the
columns with 5, but average their percentage. I dont want
to re-sort each list so that all fives and values are on
the same row. How do I write the formula? Thanks, Ken F.
 
J

jack feka

I'm not a real expert so someone may have a more elegant
solution but I had to do something like this beore.

Write a macro which loops through all the cells in your
range and use a distinct variable to accumulate all the
values in each column using an IF statement (ie. IF
celColA=5 then sumColB= sumColB + value in B). If there
are different numbers of percentages you may have to add
a variable to count up the number of cells to compute
your average. Remember you have to initilize your
variables to = 0 before you start.

Hope this helps.

Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top