Jennifer has attended:
Excel Advanced course
Formulas based on formats
Is is possible to relate a sum formula for cell format (i.e. sum all cells in x column where colour is red)
RE: formulas based on formats
Hi Jennifer. I'd approach this in two different ways. The first depends whether you are using conditional formatting to alter the format of a cell. If so, you could appropriate the criteria from that cell (say, if A12>100), cycle through all the cells in the worksheet and then perform the calculation.
Alternatively, I'd use a piece of VBA and an IF...Then...Else loop to pick out the formatting of each cell, see whether it is coloured red, add the value to an array if it is and then add those values and paste the result into the cell of my choice.
So it is possible!
Hope this helps.
Anthony
RE: formulas based on formats
Hi Jennifer,
The function SUMIF comes with a critieria. So you can simply put the existing condition for the cells being RED (I'm assuming you placed a "conditional formatting" condition to make cells red) onto SUMIF.
1) Select result cell
2) Insert function: SUMIF
=SUMIF(cell range of criteria, condition, sum range)
3) Press Enter
e.g. sum all sales over 50
Cell A1: 60
Cell B1: 30
Cell C1: 80
=SUMIF(A1:C1; ">50", A1:C1)
result: 140
Hope this helps.
Katie