+ Reply to Thread
Results 1 to 9 of 9

Formula to use in complicated replace

  1. #1
    Registered User
    Join Date
    01-19-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    5

    Formula to use in complicated replace

    Hi guys, i just hope that someone would have an idea of which formula is best to use in this case...

    I have a spreadsheet (the whole lot, just the top is here)


    2059251 On order
    Item code : 1006668HD


    2059789 On order
    2059867 On order
    Item code : 1043628

    2059866 On order
    Item code : 1045841HD



    basically what i need to do is: replace on order with the next value, so the final look should be:
    2059251 1006668HD
    Item code : 1006668HD


    2059789 1043628
    2059867 1043628
    Item code : 1043628

    2059866 1045841HD
    Item code : 1045841HD


    Any ideas on even which formula to use and how to specify it? Can not do it manually, as the report is huge...

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to use in complicated replace

    Hi, welcome to the forum

    I did this with a helper column...
    A
    B
    1
    2059251 On order 2059251 1006668HD
    2
    Item code : 1006668HD Item code : 1006668HD
    3
    4
    5
    2059789 On order 2059789 1043628
    6
    2059867 On order 2059867 1043628
    7
    Item code : 1043628 Item code : 1043628
    8
    9
    2059866 On order 2059866 1045841HD
    10
    Item code : 1045841HD Item code : 1045841HD


    B1=IF(A1="","",IF(ISNUMBER(--LEFT(A1,1)),SUBSTITUTE(A1,"On order",MID(OFFSET(A1,MATCH("Item Code*",A1:A3,0)-1,0),13,99)),A1))

    If needed, you can then copy/paste values the helper column back over he original data, then delete the helper

    This will work if you have a max of 3 lines per item
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-19-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula to use in complicated replace

    Hi FDibbins,

    Thank you

    And thanks for the prompt reply

    But look what happens for me:

    Capture.jpg

    Looking at your result i thought that after I've got the result that your screen shot shows, I'll just divide the result by space into two different columns, copy and paste and it's done
    But it substitutes my cell with the one of the left, not down, and unfortunately I am not able to modify the formula because I can't get my head around what's what...
    Sorry, can you please let me know if i do something wrong...

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to use in complicated replace

    OK, you didnt say you wanted them in 2 columns TRy this...
    B1=IF(A1="","",LEFT(A1,IF(LEFT(A1,1)="I",11,FIND(" ",A1,1)-1)))
    C1=IF(A1="","",MID(OFFSET(A1,MATCH("Item Code*",A1:A3,0)-1,0),13,99))

  5. #5
    Registered User
    Join Date
    01-19-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula to use in complicated replace

    FDibbins, it doesn't do anything now... at all...

  6. #6
    Registered User
    Join Date
    01-19-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    5

    Re: Formula to use in complicated replace

    Capture.jpg

    Sorry and this is the screenshot... maybe i do something wrong?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to use in complicated replace

    See the attached
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-19-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    5

    Thumbs up Re: Formula to use in complicated replace

    Thanks you very much! It worked!!! :D

    Thanks a lot for your help!!!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Formula to use in complicated replace

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

+ 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. Replace Fill Down, Complicated Equation
    By thequiff in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-15-2012, 10:03 AM
  2. IF formula help..little bit complicated
    By jgy6000 in forum Excel General
    Replies: 1
    Last Post: 03-02-2011, 09:13 AM
  3. Complicated Find - Replace
    By abertrand in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2009, 01:13 PM
  4. Rather Complicated Formula
    By paulmaddock in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-08-2008, 09:36 AM
  5. Userform, Find and Replace - Really Complicated
    By HelenMcKenzie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2006, 06:22 AM

Tags for this Thread

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