# Horizontal Subtotals?

#### mgirvin

##### Well-known Member
Dear Smartest Excelers In The World,

The Subtotal feature works vertically. Is there a way to do it horizontally?

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Can you post some sample data so we can see how the Subtotals might be arranged?
lenze

Hello mgirvin,

for my proposal you need a helprow and you have to define a name as follows:

Here is the list with all columns visible:
Excel Workbook
ABCDEF
15555525
244444Helprow
Sheet
#VALUE!
</td></tr></table></td></tr></table>

After hiding/unhiding colums the result in cell F1 is refreshed after pressing F9:
Excel Workbook
ABEF
155515
2444Helprow
Sheet
#VALUE!
</td></tr></table></td></tr></table>

May be you have to change the words "Zelle" to "cell", and "Breite" to "Width" in the formula defining the name. I cannot show that because I'm using German Excel.

Last edited:
Dear lenze and Beate Schmitz,

Sorry I did not post back sooner – I asked the question and then was delayed in getting back to check for an answer. Actually, all I was asking was if there was a way to get the Subtotal feature to work horizontally.

As for data setup, I have field names in F1:F3, data in cells G1:AL4, row one is sorted, and row 3 has the numbers to sum. So in row 4 for Subtotals I have used the formula:

=IF(G1<>H1,SUMPRODUCT(\$G\$3:\$AL\$3,--(\$G\$1:\$AL\$1=G1)),"")

And this works fine, I was just wondering if Subtotals feature would automate the process.

As for the CELL &"width" formula setup, that is quite a clever trick. I have not seen CELL and “width” used in such a way before. That is a good one for my Excel Toolbox!

... So in row 4 for Subtotals I have used the formula:

=IF(G1<>H1,SUMPRODUCT(\$G\$3:\$AL\$3,--(\$G\$1:\$AL\$1=G1)),"")

I meant to say:

... So in row 4 for Subtotals I have used the formula:

=IF(G1<>H1,SUMIF(\$G\$1:\$AL\$1,G1,\$G\$3:\$AL\$3),"")

Replies
4
Views
92
Replies
2
Views
83
Replies
6
Views
77
Replies
1
Views
77
Replies
5
Views
180

1,196,406
Messages
6,015,098
Members
441,870
Latest member
kojack

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back