+ Reply to Thread
Results 1 to 4 of 4

if statement to replace values

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    4

    if statement to replace values

    hello experts,

    Mapping:

    107507-0000 314071
    921570-0000 324000

    check Values and replace first 11 digits (this is on a different spreadsheet):
    921570-0000-50-C
    921570-0000-10-c
    107507-0000-30-C
    107507-0000-40-C


    I would like to replace values based on the mapping. for example: if the mapping is 107507-0000 to 314071 then i would like to replace 107507-0000-40-C and 107507-0000-30-C to 314071-40-C and 314071-30-C respectively.

    Thanks

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: if statement to replace values

    Usually best to provide a spreadsheet so that any formula provided can be relevant.

    So, I would attack this with a VLOOKUP, using the LEFT function to just search for the first 11 characters, then returning the data from the second column (e.g. 314071), then appending the fiver RIGHT characters to that result.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    09-11-2014
    Location
    US
    MS-Off Ver
    2010
    Posts
    4

    Re: if statement to replace values

    Hi Pauley,
    Thanks for your reply,
    Could you please explain this with an example from the data i provided.

    Regards

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: if statement to replace values

    Pauley was proposing something like this:

    =VLOOKUP( LEFT(cell, 11), table, 2, FALSE) & RIGHT(cell, 5)

+ 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] Can You Put An IF Statement Inside a REPLACE Statement?
    By nevi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2014, 07:34 AM
  2. [SOLVED] If statement, then sum, replace and delete.
    By christopherL in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-07-2013, 12:00 PM
  3. Replies: 4
    Last Post: 06-27-2010, 02:40 AM
  4. Replace 0s with blanks - IF statement
    By thomas.szwed in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2007, 11:59 AM
  5. How do I use an if statement with Find and Replace
    By Gerald in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-03-2005, 06: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