How to Subtotal for Value in Specific Cell in Excel

Sometimes we may want to sum within some criteria in excel, actually, we can use SUMIF function directly instead of SUM for some special instance. For example, if we just want to get subtotal for one product among all products, we can use SUMIF function here to only calculate the total for the specific product properly. In this tutorial, we will show you how to subtotal for the value in a specific cell in worksheet.

Precondition:

Prepare tables in a worksheet like below:

We can use SUM function to calculate total price for all products in a week. But If we only want to subtotal for product ‘043C’ or ‘063A’ during two weeks, how can we do?

Method: Subtotal for Value in Specific Cell by Formula

Step 1: In E2 which is just net to product ‘043C’, enter the formula:

=SUMIF($A$3:$A$17,D3,$B$3:$B$17).

In this formula, $A$3:$A$17 this selected range will provide all criteria, we add $ before row and column to make this range as an absolute reference, so if you want to copy down this formula, the range will not be changed. D3 is the sum criteria in the formula, if D3 can be found in $A$3:$A$17, then mapping value from $B$3:$B$17 will be summed for D3.

Step 2: Click Enter to get result. Verify that correct value 2000 is returned.

Step 3: Drag the handle down to copy the formula. Verify that correct value 6000 is returned.

Step 4: If you change product in D3, the subtotal value is updated accordingly. For example, copy ‘037B’ to D3, then subtotal is recalculated and updated immediately. So, you can copy product to this cell then you can get subtotal for this product, D3 is the specific cell to show the criteria.

Note:

In this instance, if the range is long, you can also use formula =SUMIF(A:A,D3,B:B) to get subtotal for specific cell.

Related Functions


  • Excel SUMIF Function
    The Excel SUMIF function sum the numbers in the range of cells that meet a single criteria that you specify. The syntax of the SUMIF function is as below:=SUMIF (range, criteria, [sum_range])…
Related Posts

How to Sum if Equal to Many Items or A Range in Excel
How to Sum if Equal to Many Items 12

If we want to sum numbers from a range with criteria, we often select SUMIF of SUMIFS functions as the first choice to create a formula. The criteria can be a number or an array or a collection of some ...

How to Sum if Equal to X or Y in Excel
How to Sum if Equal to X or Y 19

In daily work, if we want to sum numbers from a range, and only sum the numbers which being equal to X or Y in the range, we can create a formula with Excel build-in functions to get the result. ...

How to Sum if Contains an Asterisk
How to Sum in Last N Days 14

In our daily life, we may want to sum amounts or sales for a specific period, for example in last N days. Sum numbers in Excel is easy to run, we can apply SUM function. But if we want to ...

How to Sum if Contains an Asterisk
How to Sum if Contains an Asterisk 7

To add numbers together we need to apply SUM function. And if we want to add numbers based on some conditions, we can add criteria with the help of SUMIFS function, SUMIFS can filter data with multiple criteria effectively. If ...

How to Sum in Vertical Range
How to Sum in Vertical Range 8

If we want to add numbers based on some conditions in Excel worksheet, we can add criteria with the help of SUMIFS function, SUMIFS can filter data with multiple criteria effectively. In this article, we will introduce you the method ...

How to Sum in Horizontal Range
How to Sum in Horizontal Range9

To add numbers together we need to apply SUM function. But if we want to add numbers based on some conditions, we can add criteria with the help of SUMIFS function, SUMIFS can filter data with multiple criteria effectively. In ...

How to Sum with Criteria and Or Logic in Excel
How to Sum with Criteria and Or Logic in Excel 8

To add numbers together we need to apply SUM function. And if we want to add numbers based on some conditions, we can add criteria with the help of SUMIFS function, SUMIFS can filter data with multiple criteria effectively. If ...

How to Subtotal Values for Groups and Only Keep One Subtotal for A Group in Column
How to Subtotal Values for Groups and Only Keep One Subtotal for A Group in Column14

Sometimes we may meet the case that subtotal values for different groups and only record a subtotal value for one group in a column, for other cells in this group, keep them blank. Today we will introduce you how can ...

How to Sum by Formula If Cells Are Not Blank in Criteria Range
How to Sum by Formula If Cells Are Not Blank in Criteria13

Sometimes we may meet the cases that some blank cells exist in criteria range or sum range. In most situations we will ignore them, so we need to filter data by ‘not blank/not empty’. Today we will introduce you how ...

How to Sum by Formula if Cell Ends with in Excel
How to Sum by Formula if Cell Ends with in Excel14

We have introduced the method of sum numbers based on criteria “sum if cell begins with” (you can refer to ‘How to Sum Data if Begins with in Excel’ on our website). In this article, we will show you the ...

Sidebar