Formula to add values as shwon beöow

Chaturvedi, Santosh 430 Reputation points
2026-09-17T12:39:52.89+00:00

Hello

See Grey cells: I want to add the values D19 to D27 for which B19 to B27 have same values .I want toplace in E19 see below.

See yellow cells : This shall repeat itself for its self for teh whole table

Kibdly adice.

User's image

Microsoft 365 and Office | Excel | Other | Windows
0 comments No comments

3 answers

Sort by: Oldest
  1. Chaturvedi, Santosh 430 Reputation points
    2026-09-17T12:42:48.1466667+00:00

    The table is large.

    The sum will be start and end as long as the values from B19 onwards remains same.

    Example for 64.65 it starts from B19 to B27

    for 61.05 it starts from B28 to B35

    and so on

    see belowUser's image

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Marcin Policht 109.5K Reputation points MVP Volunteer Moderator
    2026-09-17T12:44:04.4266667+00:00

    If B19:B27 contains the value that defines the group, and you want E19 to contain the sum of D19:D27 for all rows having the same B value, use this formula in E19:

    =SUMIF($B:$B,B19,$D:$D)

    Then copy E19 down for the entire table.

    For example, if B19:B27 all contain 1, Excel will add all corresponding values in column D where column B is 1 and place that total in E19. When you copy the formula down, B19 automatically changes to B20, B21, etc., while $B:$B and $D:$D remain fixed.

    If you actually mean the repeated value in column A (64.65, 61.05, etc.) rather than column B (ni), then the formula should instead be:

    =SUMIF($A:$A,A19,$D:$D)

    Based on your screenshot, I suspect this second formula is what you want, because the repeated values are 64.65, 61.05, etc., while ni appears to be 1 for every row.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    1 person found this answer helpful.

  3. Barry Schwarz 6,191 Reputation points
    2026-09-17T14:16:16.1466667+00:00

    Since you want the sum to appear in only the first row of each set of data, check for that condition before summing. This can be accomplished by testing the current value in column B against the value one row up. Copy this formula into cell E19

    =IF(B19=B18,"",SUMIF($B:$B,B19,$D:$D))
    

    and then propagate it down until the end of your data. Only the first row of each group will have the sum in column E.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.