+ Reply to Thread
Results 1 to 5 of 5

Calculations based on adjacent cell values

  1. #1
    Jack
    Guest

    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!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Response

    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
    Martin

  3. #3
    Marcelo
    Guest

    RE: 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!


  4. #4
    Jack
    Guest

    Re: 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.

  5. #5
    Ardus Petus
    Guest

    Re: 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" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > 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.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1