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!
Last edited by jhabel; 02-24-2010 at 11:31 AM.
In C28:
copied acrossCode:=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)))
in C29:
copied acrossCode:=SUM(INDEX(C3:C27,MATCH(1,INDEX(((C2*100>=$B$2:$B$26)*(C2*100<$B$3:$B$27)),0),0)+1):C27)
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.
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))}
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks