# subtraction in subtotals?

#### bfeist

##### New Member
How do I use the subtotals function to subtract a group of numbers with the same name in excel 2003? for a simple example:

dog 10
dog 7
cat 4
cow 24
horse 2
horse 4

i want it to say dog total 3, cat total 4, cow total 24, horse total -2, ect.. right below each change in name just like subtotals does.
if subtotals is not possible, what function can i use that will subtract the numbers if the name is the same and if the name is not the same then just print the number in the cell? when there are 2 names though i want it to skip that first cell and print the subtraction total in only the 2nd row. another simple example:

dog 10
dog 7 3
cat 4 4
cow 24 24
horse 2
horse 4 -2

### Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

#### Weaver

##### Well-known Member
Is there always 2 of each and are they always together, like the example

#### Peter_SSs

##### MrExcel MVP, Moderator
How do I use the subtotals function to subtract a group of numbers with the same name in excel 2003? for a simple example:

dog 10
dog 7
cat 4
cow 24
horse 2
horse 4

i want it to say dog total 3, cat total 4, cow total 24, horse total -2, ect.. right below each change in name just like subtotals does.
if subtotals is not possible, what function can i use that will subtract the numbers if the name is the same and if the name is not the same then just print the number in the cell? when there are 2 names though i want it to skip that first cell and print the subtraction total in only the 2nd row. another simple example:

dog 10
dog 7 3
cat 4 4
cow 24 24
horse 2
horse 4 -2
Welcome to the MrExcel board!

For the second choice, try this formula (copied down).

Excel Workbook
ABC
1TypeNumber
2dog10
3dog73
4cat44
5cow2424
6horse2
7horse4-2
8
Subtract

#### bfeist

##### New Member
Thank you sooo much!! I have over 50,000 cells so this saves me time and my sanity You guys are great!!

Replies
4
Views
209
Replies
5
Views
237
Replies
4
Views
187
Replies
8
Views
253
Replies
3
Views
83

1,190,587
Messages
5,981,799
Members
439,735
Latest member
Tony_P

### 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