We help IT Professionals succeed at work.

How to count rows in excel

142 Views
Last Modified: 2017-03-31
Hi guys,

I have an excel file with a column(R) named city, I need a formula to count how many rows there are for each city, so the result must be like this:

But I don't want to use any criteria

Los Angeles     10
Burbank             5
Van Nuys         11
Arcadia              8

And so on.....

Thank you in advace
Comment
Watch Question

Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:
=COUNTIF(R:R;A1)

Open in new window

Edward PamiasTeam Lead RRS Desk
Top Expert 2016

Commented:
=countif(range,"criteria")
ShumsManaging Director/Excel VBA Developer
CERTIFIED EXPERT
Distinguished Expert 2018

Commented:
You can use below formula for each city, Assuming you have City Name in cell cell A1
=COUNTIF(R:R, A1)

Open in new window

Edward PamiasTeam Lead RRS Desk
Top Expert 2016

Commented:
I should have read more carefully. ;)
Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:
Was still editing :). Always forget to change ; to ,
Paste this in B1 and copy down. This assumes data (Los Angeles) starts at A1
=COUNTIF(R:R,A1)

Open in new window

Excel & VBA Expert
CERTIFIED EXPERT
Most Valuable Expert 2018
Awarded 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Well, the idea is to make a graph that automatically is updating while more records are adding.
Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
ShumsManaging Director/Excel VBA Developer
CERTIFIED EXPERT
Distinguished Expert 2018
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Edward PamiasTeam Lead RRS Desk
Top Expert 2016
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Subodh Tiwari (Neeraj)Excel & VBA Expert
CERTIFIED EXPERT
Most Valuable Expert 2018
Awarded 2015

Commented:
Well, the idea is to make a graph that automatically is updating while more records are adding.
In that case convert you data range into an Excel Table so the source data for a graph or the pivot table will automatically be updated.
Edward PamiasTeam Lead RRS Desk
Top Expert 2016

Commented:
use an offset formula for the name range

=offset($a$1,0,0,counta($a:$a),10)  <--- here you put the number of columns of your sheet 10 is just an example

Author

Commented:
Guys, I'm sorry for the delay, I was working in an other things but finally, I used the pivot option as subodh suggested and it is working good.

Thank you guys.

:)

Author

Commented:
Great job!!!
Subodh Tiwari (Neeraj)Excel & VBA Expert
CERTIFIED EXPERT
Most Valuable Expert 2018
Awarded 2015

Commented:
You're welcome. Glad we could help.
Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:
Glad we could help.
Please remember to endorse my, or any other expert's comments that you found helpful by clicking on the "Thumb's Up" button

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.