Search code examples
excelexcel-formulaconditional-formatting

How to add the current column reference in SUM function?


Something like this:

=SUM($A1:CELL("ADDRESS"))

Is there any way to do this?

Edit: consumed stock control

My request for help is just for ease of maintenance, I'm not an expert on this kind of thing, so please ignore my ignorance.

The columns marked in yellow are the inventory shipments, and every time they are consumed, conditional formatting makes them green.

Whenever I create new submissions, I need to edit the formula and add the current column reference (it's marked in yellow on the right: SUM($F5:$G5)).

I would like to be able to leave it the way I ordered it, to create an easy rule for anyone to add to the column.


Solution

  • Use a rule with mixed references:

    =AND($E5<>0,F5<>0,ISNUMBER($E5),SUM($F5:F5)<=$E5)
    

    and apply it to multiple columns:

    enter image description here

    In Portuguese (I think):

    =E($E5<>0;F5<>0;E.NUM($E5);SOMA($F5:F5)<=$E5)