+ Reply to Thread
Results 1 to 8 of 8

Thread: Data - Concatenate If Vlookup

  1. #1
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    147

    Question Data - Concatenate If Vlookup

    AIM/ Problem ›—›› We need to get a total of 20 digits 'Final No.' in the next column by using below conditions and restrictions. The 'Final No.' must be appeared as following:
    Examples: 00MR_No.000KP_No.

    Please check the whole problem in detail with my approach in the attached MS Excel workbook, help me out!

    Thanks in Advance!
    Attached Files Attached Files
    Last edited by SunOffice; 08-21-2010 at 08:33 PM.

  2. #2
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,786

    Re: Data - Concatenate If Vlookup

    vlookup needs to be
    =VLOOKUP(--MID(D2,1,1),Ln_number,2,FALSE) or format your Ln_number range as text before entering values in it as text


    --MID(D2,1,1) could simply be --left(d2)
    d2 could be shortened to
    =IF(OR(LEN(B2)<4,LEN(B2)>8),"",TEXT(B2,"00000000"))
    e2
    =IF(OR($B2="",LEN($B2)<4,LEN($B2)>8),"",LEN($D2))
    then i got confused!
    Last edited by martindwilson; 08-21-2010 at 09:11 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    147

    Re: Data - Concatenate If Vlookup

    Hey martindwilson, Thanks for ur quick reply!

    I appreciate ur short tricks, but wht made you confuse in this, plz tell.

    u told:
    vlookup needs to be
    =VLOOKUP(--MID(D2,1,1),Ln_number,2,FALSE) or format your Ln_number range as text before entering values in it as text


    --MID(D2,1,1) could simply be --left(d2)
    Can u plz tell me how to use these - - (double minus sign together)? when I used ur this vlookup formula, data appeared ....Thanks!

    format your Ln_number range as text before entering values in it as text
    I don't get ur this above statement exactly. do u want me to keep this 'Ln_number' range in to the number or general or text format (by using Ctrl+1) ? Wht was there in the sheet, which was stopping me to get the desired output?
    Last edited by SunOffice; 08-21-2010 at 09:36 PM.

  4. #4
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Data - Concatenate If Vlookup

    SunOffice, please don't use chat room speak in this forum.

  5. #5
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,786

    Re: Data - Concatenate If Vlookup

    mid or left return text values. so left(123) = 1 but is text
    use of -- changes that to a real number . you can also use left(a1)+0 or left(a1)*1 or value(left(a1))
    your lookup table is constructed of real numbers so that's why vlookup couldn't find a match
    if you had formatted the cells in the table as text BEFORE entering values anything entered would be text and the vlookup would have worked as it stands
    Last edited by martindwilson; 08-21-2010 at 09:42 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    147

    Re: Data - Concatenate If Vlookup

    ...?? :O teylyn!

    sorry, I'm very new to this website, I'll take care of all the rules further. btw u mean to asking to repliers in general or something else?
    Last edited by SunOffice; 08-21-2010 at 10:33 PM.

  7. #7
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    147

    Question Re: Data - Concatenate If Vlookup

    I've just tried to solve the problem as per the worksheet - AIM (Object), I've almost got my desired solution (column H), but still need your help guys to give it the exact final solution (as per column J formula says), which shows a msg too if any condition fails.

    I don't know that why is the formula in column 'J' giving me the same result as column 'H', not displaying the error msg - "Insert a correct MR No." ?

    Note — As I've got the 'Final No.' in column H and J based on columns D and E, now wht I just want more is;
    If LEN($B4)<4,LEN($B4)>8,LEN($B4)<15,LEN($B4)>15
    display a error msg too in the 'Final result' columns (plz check the formula in the column 'J' for detailed requirments).

    Plz help me out and correct the calculation.

    Thank in Advance!
    Attached Files Attached Files
    Last edited by SunOffice; 09-04-2010 at 08:51 AM.

  8. #8
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    147

    Thumbs up Re: Data - Concatenate If Vlookup OR AND

    Thanks to Mr. martindwilson

    You've made formulas easy and more effective!

    Now I've solved the whole problem.


    Guys! It's finally SOLVED!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0