+ Reply to Thread
Results 1 to 14 of 14

count how many numbers in a range

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Utah
    MS-Off Ver
    Excel 2010
    Posts
    45

    count how many numbers in a range

    I have 2 columns. Column A contains a phone number i.e. 213-555-1234, column B contains the last 4 digits of the last number in the phone number range i.e. 1264. I'm looking to add a third column. I would like column C to have the total number of phone numbers. In the examples provided this would be 31. Any idea what formula I should be using?

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: count how many numbers in a range

    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    08-20-2012
    Location
    Utah
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: count how many numbers in a range

    This worked great. Thank you.

    Follow up question, and this may need to go in the VBA section, but is there a way I can run a macro to show all of the numbers in the ranges. I have about 150 rows where column A is the 10 digits, and column B is 4 digits (which are the last 4 in the range). Is there something I can run to output each individual number?
    Last edited by rp1783; 03-18-2015 at 05:04 PM.

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: count how many numbers in a range

    You could always just drag that formula down for each respective row.

    If that's not what you're talking about, I'd recommend slapping an example together and posting it here.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    I can write some VBA as well, if you post the attachment in the next 45 minutes.

  5. #5
    Registered User
    Join Date
    08-20-2012
    Location
    Utah
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: count how many numbers in a range

    I've attached an example. Sheet 1 shows the data I have times about 150 rows. Sheet 2 shows the output I'm looking for.
    Attached Files Attached Files

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: count how many numbers in a range

    How about this:

    Please Login or Register  to view this content.
    And with notations:
    Please Login or Register  to view this content.
    Last edited by daffodil11; 03-18-2015 at 05:47 PM.

  7. #7
    Registered User
    Join Date
    08-20-2012
    Location
    Utah
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: count how many numbers in a range

    Getting an error runtime 6 overflow error.

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: count how many numbers in a range

    Sounds like maybe you have more than 150.

    change integer to long

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Integer data types only extend from -32k to 32k

  9. #9
    Registered User
    Join Date
    08-20-2012
    Location
    Utah
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: count how many numbers in a range

    Ok, so it worked for the first row, but the sheet I have has many rows. I should have been more clear. I've attached another example where sheet 2 shows the output of what I'm trying to accomplish.
    Attached Files Attached Files

  10. #10
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: count how many numbers in a range

    I should really read up on my variables more.

    We'll just use a double. I'm apparently bad at counting.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by daffodil11; 03-18-2015 at 06:51 PM.

  11. #11
    Registered User
    Join Date
    08-20-2012
    Location
    Utah
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: count how many numbers in a range

    YES!!! works great!!! Thank you!

  12. #12
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: count how many numbers in a range

    Awesome. Glad I could help out.

  13. #13
    Registered User
    Join Date
    08-20-2012
    Location
    Utah
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: count how many numbers in a range

    So one more question. some of the numbers in column B had preceding zeroes (so column B may only have 2 or 3 digits). These are not pulling over to sheet, and in fact, none of the numbers in that range are. I tried to format those specific cells to add the zero(es), but that didn't seem to work. Any suggestions?

  14. #14
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: count how many numbers in a range

    Heck yeah.

    We alter the concatenation line to reformat the Column B cell value as text. In Spreadsheet world it looks like =Text(reference,"0000"). In VBA it's Format(reference,"0000")

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by daffodil11; 03-18-2015 at 07:23 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Is it possible to count some numbers in a range(Descending order range)
    By amitgurus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2013, 10:59 AM
  2. Is it possible to count some numbers in a range(Descending order range)
    By amitgurus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2013, 08:41 AM
  3. [SOLVED] get a count of numbers whose value falls within a given range
    By LyleB_Austin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. get a count of numbers whose value falls within a given range
    By Trevor Shuttleworth in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 04:05 AM
  5. [SOLVED] Count comma separated numbers, numbers in a range with dash, not t
    By Mahendra in forum Excel General
    Replies: 0
    Last Post: 08-08-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1