+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    12-23-2009
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Finding sums using conditionally formatted cells

    Hi,

    I have been wracking my brains over this one. Attached is a matrix where, for each cell, if the value of its column header (found in cells C2:T2) is greater than or equal to the value of the row header (found in cells B3:B27) above it and less than the value of the row header on the same line as it, the cell is highlighted light green using conditional formatting. How would you calculate the following?

    1) for each column, the sum of all the cells above the green highlighted box
    2) for each column, the sum of all of the cells below the green highlighted box

    I have been able to calculate #1 by using a sum(if) array function but when I apply this to #2 I always get the value included in the box. How do you calculate #2, or barring that, find the value of the conditionally formatted box?

    Thanks!
    Attached Files Attached Files
    Last edited by jhabel; 02-24-2010 at 11:31 AM.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Finding sums using conditionally formatted cells

    In C28:

    Code:
    =IF(MATCH(1,INDEX(((C2*100>=$B$2:$B$26)*(C2*100<$B$3:$B$27)),0),0)-1=0,0,SUM(C3:INDEX(C3:C27,MATCH(1,INDEX(((C2*100>=$B$2:$B$26)*(C2*100<$B$3:$B$27)),0),0)-1)))
    copied across

    in C29:

    Code:
    =SUM(INDEX(C3:C27,MATCH(1,INDEX(((C2*100>=$B$2:$B$26)*(C2*100<$B$3:$B$27)),0),0)+1):C27)
    copied across
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    12-23-2009
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Finding sums using conditionally formatted cells

    Thanks! Both worked great. The first one (C28:T28), however, seemed a little too complex for me so I stuck with my original function, copied across:

    {=SUM(IF($B$3:$B$27<=(C$2*100),C$3:C$27,0))}

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.2.0