+ Reply to Thread
Results 1 to 11 of 11

Any way to Fill that's complex?

  1. #1
    Registered User
    Join Date
    02-18-2009
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    6

    Any way to Fill that's complex?

    I am doing some work that involves adding similar groups to a sheet. To make it easier to explain here's this:

    18048 Feeder 1 Phase 2 Over Voltage
    18048 Feeder 1 Phase 2 High Current
    18048 Feeder 1 Phase 3 Loss of Voltage
    18048 Feeder 1 Phase 3 Over Voltage
    18048 Feeder 1 Phase 3 High Current
    18048 Low External Battery Voltage
    18048 External Battery Test
    18048 Feeder 1 VARs Change
    18048 Undefined
    18048 Undefined
    18048 Undefined
    18048 Undefined
    18048 Undefined
    18048 Undefined
    18048 Undefined
    18048 Undefined
    18048 Undefined
    18048 Undefined
    *18048 DEVICE ENABLED
    *18048 SCHEDULED POLLS ENABLED
    *18048 UNSOLICITED RESPONSES ENABLED
    *18048 DEMAND POLL IN PROGRESS
    *18048 DEVICE RESTART IN PROGRESS
    *18048 TIMESYNC IN PROGRESS
    *18048 PROPAGATION DELAY IN PROGRESS
    *18048 PRIMARY COM CHANNEL OK
    *18048 SECONDARY COM CHANNEL OK
    *18048 PRIMARY COM CHANNEL IN USE
    *18048 SECONDARY COM CHANNEL IN USE
    *18048 IIN RESTART BIT STATE
    *18048 IIN TROUBLE BIT STATE
    *18048 IIN LOCAL BIT STATE
    *18048 IIN BUFFER OVERFLOW BIT STATE
    *18048 IIN CONFIG. CORRUPT BIT STATE


    Now the next group will have 18049 all other text the same, then 18050 and so on. Excel is not smart enough to see the pattern so i cant just drag down and have it fill for me. Is there any possible way to do this so it's easier and I dont have to 'copy, past, replace' 'copy, past, replace' 'copy, past, replace' over and over?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Any way to Fill that's complex?

    Is that all in ONE cell per line, or are those indicative of pieces of info in separate cells? If you can put the numbers in one column and the text in another, then you could use a formatting trick to do this.

    If A2 has 18048 in it and all the rest of the text were in B2, then that sample set would go down to row 35. In A36, enter this formula:

    =IF(LEN(A2)=5,RIGHT(A2,5)+1,"*"&RIGHT(A2,5)+1)

    And in B36, just enter:

    =B2

    Now copy those two cells down as far as you want, 1000s of cells until you have all the sets you want. Highlight the entire set of data, Ctrl-C to copy, then Edit > Paste Special > Values to remove the formulas and lock the values in as real entries.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-18-2009
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Any way to Fill that's complex?

    Unfortunately they are all in one column. Im thinking perhaps I can un-concatenate somehow then try what you suggested

  4. #4
    Registered User
    Join Date
    02-18-2009
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Any way to Fill that's complex?

    ALright, that did it. Thank you so much.

  5. #5
    Registered User
    Join Date
    02-18-2009
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Any way to Fill that's complex?

    Quote Originally Posted by JBeaucaire View Post
    Is that all in ONE cell per line, or are those indicative of pieces of info in separate cells? If you can put the numbers in one column and the text in another, then you could use a formatting trick to do this.

    If A2 has 18048 in it and all the rest of the text were in B2, then that sample set would go down to row 35. In A36, enter this formula:

    =IF(LEN(A2)=5,RIGHT(A2,5)+1,"*"&RIGHT(A2,5)+1)

    And in B36, just enter:

    =B2

    Now copy those two cells down as far as you want, 1000s of cells until you have all the sets you want. Highlight the entire set of data, Ctrl-C to copy, then Edit > Paste Special > Values to remove the formulas and lock the values in as real entries.

    On last thing, in your example, how did you separate the first numbers/* w/ numbers from the rest of the text and keeping the rest of the text in one cell?

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Any way to Fill that's complex?

    if its re written slightly (as theres no reason for RIGHT(A2,5)+1 !)
    =IF(LEN(A2)=5,A2+1,"*"&RIGHT(A2,5)+1)
    it says
    if a2 is 5 characters long add 1 to it
    if its not 5 characters long then take the 5 rightmost characters an add 1 to them and while you,re at it add a star in front. The "*"& does that.
    it could actually be written
    =IF(LEFT(A2)="*","*"&MID(A2,2,255)+1,A2+1)
    which would work with any number from 1 and *1 up
    Last edited by martindwilson; 02-19-2009 at 09:38 AM.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Any way to Fill that's complex?

    Quote Originally Posted by BucSox79 View Post
    On last thing, in your example, how did you separate the first numbers/* w/ numbers from the rest of the text and keeping the rest of the text in one cell?
    I used the Data > Text to Columns function. I used Fixed Width and manually selected only the first set of data to "split off", I left the rest together.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Any way to Fill that's complex?

    Quote Originally Posted by martindwilson View Post
    ...as theres no reason for RIGHT(A2,5)+1 !
    =IF(LEN(A2)=5,A2+1,"*"&RIGHT(A2,5)+1)
    Yep. no reason other than me being too lazy to change each half of the IF/THEN.

  9. #9
    Registered User
    Join Date
    02-18-2009
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Any way to Fill that's complex?

    Quote Originally Posted by martindwilson View Post
    if its re written slightly (as theres no reason for RIGHT(A2,5)+1 !)
    =IF(LEN(A2)=5,A2+1,"*"&RIGHT(A2,5)+1)
    it says
    if a2 is 5 characters long add 1 to it
    if its not 5 characters long then take the 5 rightmost characters an add 1 to them and while you,re at it add a star in front. The "*"& does that.
    it could actually be written
    =IF(LEFT(A2)="*","*"&MID(A2,2,255)+1,A2+1)
    which would work with any number from 1 and *1 up
    What is the opposite of &? If & adds something to the beginning, what would add something to the end? Turns out that come groups ive found have the stars at the end of the number. So much for people being consistent lol.

  10. #10
    Registered User
    Join Date
    02-18-2009
    Location
    CT
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Any way to Fill that's complex?

    Disregard, i figured it out.

    This can be marked as solved now. Thanks again guys

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Any way to Fill that's complex?

    If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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