1
votes

I am trying to conditional format a dynamically resizing Total row of multiple tables stacked one above the other. The number of cells in the Total row may change depending upon the selection in a Year dropdown.

A  |   B   |   C    |    D    |   E   |   F   |   G   |   H    |    I    |   J   |  K  |  L  | M  |
           <Year dropdown>

   |Issues|2020-Jan|2020-Feb|2020-Mar|2020-Apr|2020-May|2020-Jun|  |  |  |  |  |  |
   --------------------------------------------------------------------------------
   | abc  | 9      |    2   | 2      | 1      | 3      | 8      |  |  |  |  |  |  |
   | def  | 1      |    3   | 7      | 1      | 5      | 3      |  |  |  |  |  |  |
   | ghi  | 2      |    1   | 3      | 1      | 1      | 2      |  |  |  |  |  |  |
   --------------------------------------------------------------------------------
   |Total | 12     |    6   | 12     |  3     | 9      | 13     |  |  |  |  |  |  |
   --------------------------------------------------------------------------------

I am using this formula to highlight the Total row. However, it is highlighting the entire row depending upon what range is set in the Conditional Formatting > Apply to Range box. I want to highlight only the numeric cells i.e. exclude blank cells.

=ISNUMBER(SEARCH("total",$B1))

This highlights the entire Total row including any blank cells. I modified it to exclude any blank cells in row, but no joy!

=AND(ISNUMBER(SEARCH("total",$B1)), SEARCH("total",$B1)<>""))
2

2 Answers

1
votes

Use formula:

=(ISNUMBER(SEARCH("total",$B1))+(($B1:$Z1<>"")))>1

enter image description here

2
votes

You can also do it like this, relying on relative addressing to modify the formula as it's effectively dragged across the formatted area:

=and(isnumber(search("Total",$B3)),B3<>"")

enter image description here