Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Check rows for duplicate references and add related data

Excel 2002. I have a sheet containing 27K rows of data, each row
referenced by a reference number in column A. Many of the rows have
duplicate or triplicate references e.g.
01/010/0002
01/010/0014
01/012/0020
01/012/0020
01/012/0020
01/013/0134
01/014/0004
01/014/0004
but contain different values in subsequent columns.
What I need to do is identify the rows where the references are the same
and sum data in the corresponding rows e.g. for 01/012/0020 above I need
to sum the contents of column C for the 3 related rows and for
01/014/0004 sum the contents of column C for the 2 related rows. I know
how to identify duplicates in column A using =countif(A:A,A1) which will
give me 2 where there is a duplicate entry or 3 where there is a
triplicate entry, but I am not sure where to go from there. I imagine
that I need to extract the data to another range to sum the data in
column C for each reference.
Grateful for any assistance.
--
Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Check rows for duplicate references and add related data

Take a look at Data|Subtotals (if your data is in sorted order).

Or even Data|Pivottable.

If you want to read more about the pivottable stuff, you may want to look at
some links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx

Robert wrote:

Excel 2002. I have a sheet containing 27K rows of data, each row
referenced by a reference number in column A. Many of the rows have
duplicate or triplicate references e.g.
01/010/0002
01/010/0014
01/012/0020
01/012/0020
01/012/0020
01/013/0134
01/014/0004
01/014/0004
but contain different values in subsequent columns.
What I need to do is identify the rows where the references are the same
and sum data in the corresponding rows e.g. for 01/012/0020 above I need
to sum the contents of column C for the 3 related rows and for
01/014/0004 sum the contents of column C for the 2 related rows. I know
how to identify duplicates in column A using =countif(A:A,A1) which will
give me 2 where there is a duplicate entry or 3 where there is a
triplicate entry, but I am not sure where to go from there. I imagine
that I need to extract the data to another range to sum the data in
column C for each reference.
Grateful for any assistance.
--
Robert


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Check rows for duplicate references and add related data

This will work if you can put the result in an adjacent column; you can
modify the approach if you need to:

At the end of your columns of data put a column that uses your COUNTIF to
count the multiples, but instead of counting the whole column, only count up
to the line you are on - thus for row 50 the formula would be:
=COUNTIF($A$1:$A50,$A50)
Reason: this will count duplicate entries ABOVE the current row, so it will
number each one in sequence (1 for the first row of a particular reference, 2
for the second, etc). Now you can identify the first one in each group and
on that line calculate your total using a SUMIF, so in the next column over
use this formula to sum the total for a particular reference (I will again
write it as for row 50, and assume the prior formula is in column D and I
want to sum Column C):
= IF($D50=1,SUMIF($A:$A,$A50,$C:$C),"")
So now once for each reference, on the first row for that particular
reference, the total of column C where A is equal to the reference value
should be calculated. You could even put in some sort of label to identify
it (in an adjacent column):
= IF($D50=1,"TOTAL FOR "&$A50&":","")
Hope this helps - at least to give some ideas you might be able to use.

"Robert" wrote:

Excel 2002. I have a sheet containing 27K rows of data, each row
referenced by a reference number in column A. Many of the rows have
duplicate or triplicate references e.g.
01/010/0002
01/010/0014
01/012/0020
01/012/0020
01/012/0020
01/013/0134
01/014/0004
01/014/0004
but contain different values in subsequent columns.
What I need to do is identify the rows where the references are the same
and sum data in the corresponding rows e.g. for 01/012/0020 above I need
to sum the contents of column C for the 3 related rows and for
01/014/0004 sum the contents of column C for the 2 related rows. I know
how to identify duplicates in column A using =countif(A:A,A1) which will
give me 2 where there is a duplicate entry or 3 where there is a
triplicate entry, but I am not sure where to go from there. I imagine
that I need to extract the data to another range to sum the data in
column C for each reference.
Grateful for any assistance.
--
Robert

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Check rows for duplicate references and add related data

Many thanks for the suggestions.

Robert

In message , K Dales
writes
This will work if you can put the result in an adjacent column; you can
modify the approach if you need to:

At the end of your columns of data put a column that uses your COUNTIF to
count the multiples, but instead of counting the whole column, only count up
to the line you are on - thus for row 50 the formula would be:
=COUNTIF($A$1:$A50,$A50)
Reason: this will count duplicate entries ABOVE the current row, so it will
number each one in sequence (1 for the first row of a particular reference, 2
for the second, etc). Now you can identify the first one in each group and
on that line calculate your total using a SUMIF, so in the next column over
use this formula to sum the total for a particular reference (I will again
write it as for row 50, and assume the prior formula is in column D and I
want to sum Column C):
= IF($D50=1,SUMIF($A:$A,$A50,$C:$C),"")
So now once for each reference, on the first row for that particular
reference, the total of column C where A is equal to the reference value
should be calculated. You could even put in some sort of label to identify
it (in an adjacent column):
= IF($D50=1,"TOTAL FOR "&$A50&":","")
Hope this helps - at least to give some ideas you might be able to use.

"Robert" wrote:

Excel 2002. I have a sheet containing 27K rows of data, each row
referenced by a reference number in column A. Many of the rows have
duplicate or triplicate references e.g.
01/010/0002
01/010/0014
01/012/0020
01/012/0020
01/012/0020
01/013/0134
01/014/0004
01/014/0004
but contain different values in subsequent columns.
What I need to do is identify the rows where the references are the same
and sum data in the corresponding rows e.g. for 01/012/0020 above I need
to sum the contents of column C for the 3 related rows and for
01/014/0004 sum the contents of column C for the 2 related rows. I know
how to identify duplicates in column A using =countif(A:A,A1) which will
give me 2 where there is a duplicate entry or 3 where there is a
triplicate entry, but I am not sure where to go from there. I imagine
that I need to extract the data to another range to sum the data in
column C for each reference.
Grateful for any assistance.
--
Robert

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
moving duplicate data in rows to columns with same name Jennifer B. Excel Discussion (Misc queries) 2 June 25th 08 03:47 PM
Row data duplicate check. Matt Carter Excel Discussion (Misc queries) 1 January 4th 08 07:20 PM
Import data and keep duplicate rows of data mrdata Excel Discussion (Misc queries) 0 March 23rd 06 12:24 AM
Check for duplicate data WBTKbeezy Excel Worksheet Functions 1 February 10th 06 03:20 AM
Comparing 2 rows for duplicate data bkbri[_7_] Excel Programming 4 April 20th 04 08:39 AM


All times are GMT +1. The time now is 12:24 AM.

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

About Us

"It's about Microsoft Excel"