Solved

Excel 2013 Counting Rows per record

Posted on 2014-02-03
2
297 Views
Last Modified: 2014-02-20
All,
I am working with a spreadsheet with ~60,000 rows.  Each row has data pertaining to one column (Column A).  I want to count the number of times a value in Column B is associated with a unique value in Column A.  And a value in Column B can appear multiple times per unique value in Column A; we only want to a Column B value one time per unique Column A value.

For instance:
Column A     Column B
  New York      Bob
  New York      Sue
  New York      Steve
  New York      Bob
  Chicago        Mary
  Chicago        Mary
  Chicago        Mary

In Column C, we like to have the # of unique values of column B associated with each unique value of column A, so the result would look like this:

Column A     Column B   Column C
  New York      Bob               3
  New York      Sue                
  New York      Steve
  New York      Bob
  New York      Sue
  Chicago        Mary              1
  Chicago        Mary
  Chicago        Mary

Can this be done in Excel?  And if it can, can someone tell us how?
Thanks!
0
Comment
Question by:NPRGadmin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 250 total points
ID: 39829630
Hi,

pls try this array formula

'=IF(A2=A1,"",SUM(IF(FREQUENCY(IF($A$2:$A$10=A2,MATCH($B$2:$B$10,$B$2:$B$10,0)),ROW($A$2:$A$10)-ROW(A2)+1),1)))

Open in new window


array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER

Regards
ArrayFormula.xlsx
0
 
LVL 23

Accepted Solution

by:
NBVC earned 250 total points
ID: 39829706
Since you have around 60,000 rows, perhaps using a helper column might improve efficiency over using array formulas....

Assuming your data is in columns A:B, then in C2 enter formula:

=COUNTIFS(A$2:A2,A2,B$2:B2,B2)

copied down.  (you can hide this column, if desired)

in D2 then:

=IF(A2=A1,"",COUNTIFS(A:A,A2,C:C,1))

copied down.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Formula returning #N/A 9 31
Need Excel Formula for extract out date only 17 38
Hash on Excel 13 34
macro to compare 2 Excel columns. 14 22
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question