View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jack feka jack feka is offline
external usenet poster
 
Posts: 1
Default Use one column to identify values in adjacent column.

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
-----Original Message-----
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.
.