1

I want to add two rows where a variable is same.

sample.csv:

A        B
corn     56
apple    43   
banana   54
corn     87
mango    63
apple    67
corn     30

I want to add values of B where A is same and want to store answer in another column as follows:

corn    162
apple   110
banana   54
mango    63

Can I do this in excel? If yes, then what is the formula for that? I searched a-lot but unable to reach solution.

Knowledge Seeker
  • 526
  • 7
  • 25
  • Traditionally you do this with a pivot table. Otherwise you can do it with [`sumif`](https://support.office.com/en-us/article/sumif-function-169b8c99-c05c-4483-a712-1697a653039b), provided you first create a list of unique items [in one way or another](https://stackoverflow.com/q/1429899/11683). – GSerg Dec 03 '18 at 12:48

1 Answers1

3

Try,

  1. Select an empty cell.
  2. Go to Data - Data Tools - Consolidate
  3. Select the range (both columns)
  4. Press add
  5. Tick Left column
  6. Press ok
Error 1004
  • 7,877
  • 3
  • 23
  • 46