+ Reply to Thread
Results 1 to 16 of 16

Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

  1. #1
    Registered User
    Join Date
    07-26-2015
    Location
    moon
    MS-Off Ver
    pro plus 2013
    Posts
    15

    Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    Hi All,

    As title of post is saying, I would need some help please with very detailed step by step instructions for Excel Professional Plus 2013 (windows 10). I have a static value which consist of several digits. Static value is all the time the same - it doesn't change.

    At the end of static value, without any blank space added, I would like to add all 10000 values between 0000 and 9999 including said two. After adding each one should go to new line but in the same column. Example: if static value is ''01'' then lines in the same column would be:

    010000
    010001
    010002
    010003
    010004
    ...
    019999

    I got idea that I should put those values in two separated neighbour columns, one 10000 lines with static value and another column each line containing value from 0000 to 0001 but its not working as first problem occurs already when typing ''0000'' without the quotes because it gets automatically converted to ''0'' without the quotes. Additional problem is that I tried to use function similar to ''=A1&B1'' without the quotes or ''=A1 & B1'' without the quotes in the third column, obviously on the same line but nothing occurred in the line of third column.

    Detailed step by step explanation would be much appreciated, thank you!

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    Try this...

    Data Range
    A
    B
    1
    01
    010000
    2
    010001
    3
    010002
    4
    010003
    5
    010004
    6
    010005
    7
    ------
    ------


    This formula entered in B1 and copied down as needed:

    =A$1&TEXT(ROWS(B$1:B1)-1,"0000")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    If your first value (e.g. 01) is in A1, then you can put this formula in A2:

    =$A$1&TEXT(ROWS($1:1)-1,"0000")

    then copy that down to A10001.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    07-26-2015
    Location
    moon
    MS-Off Ver
    pro plus 2013
    Posts
    15

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    I should not be typing "0000" without the quotes only because this is dynamic and not static. To each static value, dynamic ones from 0000 to 9999 should be appended at the end without space added. I tried what you said but it didn't work. It didn't even create any formula at all but I only ended up having in the cell exactly what you typed.

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    It sounds like the cell is formatted as TEXT.

    Change the cell format to General then re-enter the formula.

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    The cell might be formatted as Text, so it shows exactly what you have typed in. Format the cell as General, then press F2 as if to edit it and then press < Enter >.

    Then you can copy the formula down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    07-26-2015
    Location
    moon
    MS-Off Ver
    pro plus 2013
    Posts
    15

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    doesn't work If changing to General then 0000 gets converted to 0

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    Quote Originally Posted by tempmember View Post
    doesn't work If changing to General then 0000 gets converted to 0
    You don't enter 0000 in a cell.

    You enter the formula in the cell:

    =A$1&TEXT(ROWS(B$1:B1)-1,"0000")

  9. #9
    Registered User
    Join Date
    07-26-2015
    Location
    moon
    MS-Off Ver
    pro plus 2013
    Posts
    15

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    formula doesn't work.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    This is what I came up with using A1 with custom formatting applied as 00 which leaves A1 as a real number and not text.
    Enter in B1 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If placed in A2 and filled down this will work.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If A1 is text then Tony and Pete's formulae starting with =A$1.... will work just fine.


    A
    B
    1
    01
    010000
    2
    010000
    010001
    3
    010001
    010002
    4
    010002
    010003
    5
    010003
    010004
    6
    010004
    010005
    7
    010005
    010006
    8
    010006
    010007
    9
    010007
    010008
    10
    010008
    010009
    11
    010009
    010010
    12
    010010
    010011
    13
    010011
    010012
    14
    010012
    010013
    15
    010013
    010014
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    Quote Originally Posted by tempmember View Post
    formula doesn't work.
    Here's a small sample file that demonstrates this.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    07-26-2015
    Location
    moon
    MS-Off Ver
    pro plus 2013
    Posts
    15

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    newdoverman thank you for reply. Its not working. I tried to enter in B1 what you said. After trying to double click that B1 cell, the value of said cell finally starts acting as a formula. However when I press Enter key, I get error with the content similar to this one:

    "if typing 1 + 1, cell shows: 2
    if you want to avoid that, add single quotation mark BEFORE them
    so if you type '=1+1, cell shows: =1+1"

    This is exact content of error message. Unfortunately it doesn't say what is considered with a word ''them''

    To clarify: Only text I had in entire table is value which i expect to be STATIC one in A1 and formula in B1. Nothing else was added anywhere.

  13. #13
    Registered User
    Join Date
    07-26-2015
    Location
    moon
    MS-Off Ver
    pro plus 2013
    Posts
    15

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    Quote Originally Posted by Tony Valko View Post
    Here's a small sample file that demonstrates this.
    This is what I wanted to have result in. Exactly this. See my reply to newdoverman why it didn't work. I didn't have anything added in B column, just wanted to add the formula in B1. That could be the reason but I think nothing should be in B column at all since I was supposed to type formula A1. No idea what I was doing wrong but thank you very much for your valuable time for giving me that file.

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    I don't know what the regional settings for the moon are, but if you are really in continental Europe then you might need to use a semicolon ( ; ) instead of the comma ( , ) in the formula.

    Hope this helps.

    Pete

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

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    You're welcome. Thanks for the feedback!

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Append Dynamic Value (10000 possibilities: from 0000 to 9999) to Static Value

    I don't know what caused the problems that you faced but here is a workbook with the two formulae showing the results for both. I have no idea why you double clicked B1. You fill the formula down a column by grabbing with the cursor the small square on the lower right of the cell (fill handle) and drag down the column. If there is content beside column B then double clicking the fill handle will fill the formula down the column
    Attached Files Attached Files
    Last edited by newdoverman; 04-30-2016 at 11:53 AM.

+ 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. Replies: 5
    Last Post: 01-30-2015, 10:45 AM
  2. [SOLVED] VBA - Static code to dynamic
    By gan_xl in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2014, 11:51 AM
  3. VBA to append 0000 to string dependent upon state
    By tyantorno in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2013, 10:35 AM
  4. [SOLVED] Append dynamic number to a cell
    By ReplicaR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2012, 03:33 PM
  5. Turn static RANGE to dynamic
    By Barmoley in forum Excel General
    Replies: 7
    Last Post: 11-14-2010, 04:33 PM
  6. Replies: 4
    Last Post: 06-23-2005, 08: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