Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 151
Default identify duplicates and sum corresponding values

Hi there,

I only have 2 columns in my dataset but i have around 40,000 rows so i need
something relatively quick and easy! ID's are shown in column A and number of
days is shown in column B, there are duplicate ID's in A. I need to sum B
according to column A (i.e. for ID: 1 i need to add B1 and B2 to equal 13).
Can anyone help me with this?

A B
1 5
1 8
2 4
3 6
3 5
3 2

Thanks,
--
Amanda
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default identify duplicates and sum corresponding values

In C1:C10 enter numbers 1 to 10
In D1 enter =SUMIF(A:A,C1,B:B)
Copy this down to D10
I am assuming ID are 1 to 10
I you have loots of unknown ID's use a pivot table
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Amanda" wrote in message
...
Hi there,

I only have 2 columns in my dataset but i have around 40,000 rows so i
need
something relatively quick and easy! ID's are shown in column A and number
of
days is shown in column B, there are duplicate ID's in A. I need to sum B
according to column A (i.e. for ID: 1 i need to add B1 and B2 to equal
13).
Can anyone help me with this?

A B
1 5
1 8
2 4
3 6
3 5
3 2

Thanks,
--
Amanda



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default identify duplicates and sum corresponding values

One quick way is to use a pivot table (PT). Insert a top header row, label
in A1: ID, in B1: Days. Then select any cell within the source table, click
Data PivotTable .... Click Next Next. In step 3, click Layout, then drag
n drop ID within the ROW area, drag n drop Days within the DATA area (it'll
appear as Sum of Days), Click OK Finish. That's it.

The PT will be created in a new sheet to the left, with the required
results, eg:

Sum of Days
ID Total
1 13
2 4
3 13
Grand Total 30

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Amanda" wrote in message
...
Hi there,

I only have 2 columns in my dataset but i have around 40,000 rows so i
need
something relatively quick and easy! ID's are shown in column A and number
of
days is shown in column B, there are duplicate ID's in A. I need to sum B
according to column A (i.e. for ID: 1 i need to add B1 and B2 to equal
13).
Can anyone help me with this?

A B
1 5
1 8
2 4
3 6
3 5
3 2

Thanks,
--
Amanda



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default identify duplicates and sum corresponding values

If column A is sorted, you could also consider Excel's Subtotal feature.

Data/Subtotals




"Amanda" wrote:

Hi there,

I only have 2 columns in my dataset but i have around 40,000 rows so i need
something relatively quick and easy! ID's are shown in column A and number of
days is shown in column B, there are duplicate ID's in A. I need to sum B
according to column A (i.e. for ID: 1 i need to add B1 and B2 to equal 13).
Can anyone help me with this?

A B
1 5
1 8
2 4
3 6
3 5
3 2

Thanks,
--
Amanda

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 151
Default identify duplicates and sum corresponding values

That's great... Thanks!
--
Amanda


"Max" wrote:

One quick way is to use a pivot table (PT). Insert a top header row, label
in A1: ID, in B1: Days. Then select any cell within the source table, click
Data PivotTable .... Click Next Next. In step 3, click Layout, then drag
n drop ID within the ROW area, drag n drop Days within the DATA area (it'll
appear as Sum of Days), Click OK Finish. That's it.

The PT will be created in a new sheet to the left, with the required
results, eg:

Sum of Days
ID Total
1 13
2 4
3 13
Grand Total 30

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Amanda" wrote in message
...
Hi there,

I only have 2 columns in my dataset but i have around 40,000 rows so i
need
something relatively quick and easy! ID's are shown in column A and number
of
days is shown in column B, there are duplicate ID's in A. I need to sum B
according to column A (i.e. for ID: 1 i need to add B1 and B2 to equal
13).
Can anyone help me with this?

A B
1 5
1 8
2 4
3 6
3 5
3 2

Thanks,
--
Amanda






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default identify duplicates and sum corresponding values

Good to hear that did it here, Amanda.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Amanda" wrote in message
...
That's great... Thanks!
--
Amanda



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify the cell with Max & Min values skysusan Excel Worksheet Functions 1 November 8th 06 03:04 AM
Auto Identify Values TMc21 Excel Discussion (Misc queries) 3 July 18th 06 07:36 PM
Identify where max values are found owen080808 Excel Discussion (Misc queries) 4 April 5th 06 10:15 PM
How can I identify the two lowest values in a row? jaysmith80 Excel Worksheet Functions 2 January 7th 06 03:29 AM
identify duplicates 5thsun7thchild Excel Discussion (Misc queries) 1 September 1st 05 04:06 PM


All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"