ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculations based on adjacent cell values (https://www.excelbanter.com/excel-discussion-misc-queries/93187-calculations-based-adjacent-cell-values.html)

Jack

Calculations based on adjacent cell values
 
Hi!

I have a spreadsheet with a column that is either Red or Blue, and I'd like
to do AVG, MIN, MAX, and MEAN for the column adjacent to it. Is there a way
to do these calculations based on the adjacent cell of Red or Blue? I'd sort
the data and do it that way, but I need to do this with a number of different
columns, so I need to figure out a way to make it conditional.

Thanks and hope that makes sense!

Marcelo

Calculations based on adjacent cell values
 
Hi Jack,

try the tips on the Chip Person web site

hope this helps
regards from Brazil
Marcelo

"Jack" escreveu:

Hi!

I have a spreadsheet with a column that is either Red or Blue, and I'd like
to do AVG, MIN, MAX, and MEAN for the column adjacent to it. Is there a way
to do these calculations based on the adjacent cell of Red or Blue? I'd sort
the data and do it that way, but I need to do this with a number of different
columns, so I need to figure out a way to make it conditional.

Thanks and hope that makes sense!


mrice

Calculations based on adjacent cell values
 

You could use a user defined function to display the colorindex value of
the cell interior.

Function CellColour(Cell As Range)
CellColour = Cell.Interior.ColorIndex
End Function


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=550470


Jack

Calculations based on adjacent cell values
 
Sorry - I guess my original post wasn't clear. The cells aren't colored,
"Red" and "Blue" are the actual entries in the cells. I just need to do
calculations on adjacent cells based on whether they are in the "Red" or
"Blue" group.

Ardus Petus

Calculations based on adjacent cell values
 
Say you have col A = "Red" or "Blue"
colB = your values
cell C2 = "Red" or "Blue"
In D2 thru G2, enter formulae:
=AVERAGE(IF(A:A=$C2,B:B))
=MIN(IF(A:A=$C2,B:B))
=MAX(IF(A:A=$C2,B:B))
=MEDIAN(IF(A:A=$C2,B:B))

HTH
--
AP

"Jack" a écrit dans le message de news:
...
Sorry - I guess my original post wasn't clear. The cells aren't colored,
"Red" and "Blue" are the actual entries in the cells. I just need to do
calculations on adjacent cells based on whether they are in the "Red" or
"Blue" group.





All times are GMT +1. The time now is 03:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com