+ Reply to Thread
Results 1 to 6 of 6

Extract numbers from two cell range into a single cell.

  1. #1
    Registered User
    Join Date
    01-23-2015
    Location
    Virginia,USA
    MS-Off Ver
    Starter
    Posts
    8

    Extract numbers from two cell range into a single cell.

    I have a cell with vehicle model years (starting A:2 and ending B:2) for example A:2 is 1997 and B:2 is 2001 How can I make the single cell C:2 show the range of years for example 1997 1998 1999 2000 2001 I need this for a shopping cart that will query specific years. My files have about 15000 rows so I need to do this with a formula. Thanks.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: Extract numbers from two cell range into a single cell.

    Better (and easier) to use adjacent cells rather than put it all into one cell. Put this formula in C2:

    =IF(COLUMNS($C:C)>$B2-$A2+1,"",$A2+COLUMNS($C:C)-1)

    then copy across as far as you might need it. Then copy those formulae down.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-23-2015
    Location
    Virginia,USA
    MS-Off Ver
    Starter
    Posts
    8

    Re: Extract numbers from two cell range into a single cell.

    Thank you that seems to work. Ideally I would want them in one cell as they will be keywords for a search. This puts me on the right track though and I can merge them later. Thanks!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extract numbers from two cell range into a single cell.

    Are you open to using a VBA function to do this?

    It would be relatively easy.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    01-23-2015
    Location
    Virginia,USA
    MS-Off Ver
    Starter
    Posts
    8

    Re: Extract numbers from two cell range into a single cell.

    No I am not familiar with those.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extract numbers from two cell range into a single cell.

    Quote Originally Posted by Len Farneth View Post
    No I am not familiar with those.
    OK.

    Carry on!

+ 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. [SOLVED] Extract single cell data based on a single cell entry
    By farmerdoode in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-05-2013, 11:11 PM
  2. [SOLVED] Count occurances of numbers in a particular range in a single cell
    By dekoay in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-10-2012, 09:55 PM
  3. Replies: 2
    Last Post: 08-16-2011, 09:03 AM
  4. Range of numbers in single cell
    By Silverspell in forum Excel General
    Replies: 7
    Last Post: 11-10-2009, 06:39 AM
  5. [SOLVED] Range of numbers in a single cell
    By DRB in forum Excel General
    Replies: 2
    Last Post: 01-11-2006, 08:20 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