+ Reply to Thread
Results 1 to 12 of 12

splitting and multiplying data

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    splitting and multiplying data

    hey

    need a little help...
    i have a column of numerical data that starts with two zeroes (i.e. 00240011).
    i need to copy it to a different column in a way that each cell will be multiplying 4 times in four different rows but keeps the zeroes in the beginning of the number.
    how can it be done?

    Thnx in advanced...

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: splitting and multiplying data

    Will you please attach a sample excel file with expected result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: splitting and multiplying data

    It's not clear to me what multiplying 4 times in four different rows means.
    So post a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: splitting and multiplying data

    You add a custom format to those cells
    Select Cell Formatting and the the Number, then click on Custom and the number of 0000000 equal to the length of the number you want.
    In the formula bar you will see 4567 but in the cell it will be 0004567
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  5. #5
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: splitting and multiplying data

    hey

    I can't attach a sample file for some reason...
    So i'll try to be more clear:
    on Column A i have Numerical Data such as
    0022001
    0022045
    0023054 etc.

    on column B i have the number of repeats needed (in this case it's 4 but it can vary).
    The expected outcome should appear on column C like this:
    0022001
    0022001
    0022001
    0022001
    0022045
    0022045
    0022045
    0022045
    etc.

    i.e. - each number that appear on column A should appear 4 times on column C on 4 consecutive rows.
    i managed to get it done (Sort of) using a VLookup formula, but it's so not elegant... I'm sure there's a better way to do it, but i couldn't came up with one...
    hope you could help me.

    Thnx in advanced.

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: splitting and multiplying data

    As I stated above
    When uploading files use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments
    as the "paperclip" method does not work on this forum.

  7. #7
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: splitting and multiplying data

    attached.

    thanx.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: splitting and multiplying data

    Hello,

    Try this in C2, and copy down.

    =INDEX(A$2:A$1000,INT((ROWS(C$2:C2)-1)/4)+1)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  9. #9
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: splitting and multiplying data

    hey

    Thanks a lot. it works great...
    is there a way i could manipulate this formula to take into consideration the numbers of repeats (col. B)?
    meaning, to change the numbers of times the number appears on Col. C according to the number in Col. B (if B2 is 5 for example, i want it to appear 5 times on col/ C).
    example attached.

    Thnx.
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: splitting and multiplying data

    Quote Originally Posted by Haseeb A View Post
    Hello,

    Try this in C2, and copy down.

    =INDEX(A$2:A$1000,INT((ROWS(C$2:C2)-1)/4)+1)
    That may not work because of this

    " i have the number of repeats needed (in this case it's 4 but it can vary)."

    UPDATE: That solution definitely won't work with the new file attached as per post #9
    Last edited by Special-K; 07-28-2017 at 07:28 AM.

  11. #11
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: splitting and multiplying data

    Hello,

    My bad. The OP was uploaded a file while I was responding to the post.

    Try this.

    In C2,

    =A2

    In C3 & copy down until see zero.

    =INDEX(A:A,IFERROR(MATCH(C2,A:A,0),2)+(ROWS(C$3:C3)=SUMPRODUCT(SUMIF(A:A,A$2:INDEX(A:A,MATCH(C2,A:A,0)),B:B))))

  12. #12
    Registered User
    Join Date
    06-27-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013
    Posts
    13

    Re: splitting and multiplying data

    hey Haseeb

    it is working great!
    thanks a lot for your help!

+ 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. Splitting The data
    By sathishkm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2016, 06:35 PM
  2. [SOLVED] Any data splitting experts out there? Seeking help to split columns data
    By winfang in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-21-2014, 08:05 AM
  3. How do I combine splitting data into files then splitting the new files data into multiple
    By Lauraguthrie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 01:18 PM
  4. Replies: 2
    Last Post: 01-29-2013, 02:46 PM
  5. [SOLVED] Multiplying and sum 2 data sets
    By ViSM in forum Excel General
    Replies: 2
    Last Post: 10-21-2012, 09:25 PM
  6. splitting data
    By vinnaik1964 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-24-2012, 02:19 PM
  7. Replacing the existing Data of workbooks on splitting Data in a Master workbook
    By anchuri_chaitanya in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2012, 11:59 AM

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