How to Excel sum by color, 2.5% of people will not

For some special data readily marked several colors, and then summing the data needed for different colors.


640?

Next, let's talk about the specific steps:

Select the first to enter the formula in cell D5, then define the name of the color:

=GET.CELL(63,C5)+NOW()^0-1

640.png

Speaking about the custom name in the formula mean:

1、GET.CELL(63,C5)

GET.CELL correlation function for obtaining a cell format, content. The first parameter 63, retrieves the cell background color, the color can not be obtained Note that this function returns the conditional formatting.

GET.CELL not be automatically recalculated according to changes in the form, you must double-click the cell, it may stimulate the corresponding recalculation to return the latest results.

In the formula of the final with NOW () ^ 0-1 what role is it?

Current date and time of NOW () function returns the system is changing all the time, by its change, causing GET.CELL simultaneously forced recalculation, to achieve the purpose of update. After simply click F9, all cells are up to date on the results.

Any number other than 0 0 power, the result is 1, so NOW () ^ 0-1 result is always 0, does not affect the results. There are other common & T (NOW ()), etc., we can choose the appropriate method based on personal preferences.

Simple introduction to the meaning of the name of the custom formula, continue to the following:

Cell D5, enter the following formula, copy down:

=color

Effect equation is obtained background color value C column of cells.

640?

G5 cells enter the following formula:

=SUMIF(D:D,color,C:C)

640?

Wherein the color values ​​are obtained F5 cell background color, then sales of column C according to this summing corresponding values, return to the base Sumif use.

Note: Due to the worksheet using the macro table function, you need to select .xlsm format when you save, that is, macro-enabled workbook before the formula to calculate correctly.

Summary: While computing can be achieved by color, but always very ado, small partners in their daily work, if there is data to be specially marked, you can add notes column, write the contents of the note in the remarks column, so that subsequent summary on It will be a lot easier.

Product is slightly Library http://www.pinlue.com/

Guess you like

Origin blog.51cto.com/14325182/2412142