Forum Discussion

LilYawney's avatar
LilYawney
Brass Contributor
Apr 01, 2023
Solved

Formula not working for some cells

I want to calculate the total WIP hours per row. The formula that I am using is:   =SUM(IF(CELL("format",G3:R3)=CELL("format",$C$1),IFERROR(VALUE(TEXT(G3:R3,"[h]:mm")),0)))   All time values are ...
  • HansVogelaar's avatar
    Apr 01, 2023

    LilYawney 

    1) The CELL function does not return an array. It returns the value for the first cell in the range argument.

    So CELL("format",G3:R3) is equivalent to CELL("format",G3).

    As a consequence, if CELL("format",G3)=CELL("format",$C$3), the formula will add the values of G3:R3. Otherwise, it will return 0.

    2) CELL("format", ...) returns "G" (General) for a cell formatted as [h]:mm, there is no dedicated code for [h]:mm.

Resources