+ Reply to Thread
Results 1 to 12 of 12

Combination of IF and LEFT

  1. #1
    Registered User
    Join Date
    01-04-2010
    Location
    Amsterdam, Netherland
    MS-Off Ver
    Excel 2003
    Posts
    43

    Combination of IF and LEFT

    Hello every one.

    I need to chose (copy) an value in the column “B” having as reference the first 5 characters from the value of the cells from the column A.

    Exemple.

    Colone A **** Colone B

    12345 aaaaa **** 11112
    12312 bbbbb **** 1212312
    35758 ccccc **** 12312312
    12345aaaaa **** 11112
    12312bbbbb **** 1212312
    35758ccccc **** 12312312


    I need to chose the value in the column B for the cells corresponding to the first five caracters (left) of the cells of the column A.

    I tried with """ if ((left (A:A);5);12345; B:B)""" === """If the 5 first characters des values in the column A are equal to 12345, then chose the corresponding value in column B."""

    An better exemple is in the attached spreadsheet.

    But it doesn’t work.

    I would really appreciate if you have any other idea for solving this problem.

    Friendly
    Sokol
    Attached Files Attached Files
    Last edited by Sokol; 01-11-2010 at 09:25 AM.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Combination of "IF" and "left" comand ????

    Like this?
    Please Login or Register  to view this content.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Registered User
    Join Date
    01-04-2010
    Location
    Amsterdam, Netherland
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Combination of "IF" and "left" comand ????

    Hello.

    In your formula you are checking only one cell (A1) from the column A and choosing one cell in the column B (B1).
    I would like that the check to be done automatically in all the cells of the column A and taking out (choosing ) all the corresponding values from the column B.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Combination of "IF" and "left" comand ????

    Hi Sokol, there are a few questions about the data. Are the values in column B text or numbers?

    If numbers, try

    =IF(1*LEFT(A1,5)=12345,B1,"")

    if text, try

    =IF(LEFT(A1,5)="12345",B1,"")

    I have an inkling that this is not the complete picture. If this does not solve your issue, please post a data sample and explain in context.

    cheers

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Combination of "IF" and "left" comand ????

    Sokol,

    regarding your last post ...

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  6. #6
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Combination of "IF" and "left" comand ????

    As I understood u want to lookup entire column A by first 5 symbols in and return coressponding value in column B. So

    Please Login or Register  to view this content.
    OR

    Please Login or Register  to view this content.
    This is array formula and needs to be entered with CTRL SHIFT ENTER. In this case I wouldnt advice to use entire column range.
    Last edited by contaminated; 01-11-2010 at 06:28 AM.

  7. #7
    Registered User
    Join Date
    01-04-2010
    Location
    Amsterdam, Netherland
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Combination of "IF" and "left" comand ????

    An better exaple is in the attached spreadsheet .
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-04-2010
    Location
    Amsterdam, Netherland
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Combination of "IF" and "left" comand ????

    See the attached file.
    Attached Files Attached Files

  9. #9
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Combination of "IF" and "left" comand ????

    Try

    Please Login or Register  to view this content.
    Where D2 is 83510

    This is array formula and needs to be entered with CTRL SHIFT ENTER

  10. #10
    Registered User
    Join Date
    01-04-2010
    Location
    Amsterdam, Netherland
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Combination of "IF" and "left" comand ????

    Can you sent to me the example spreadsheet with your formula inside because I have some problems applying it .

    Thanks.

  11. #11
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Combination of "IF" and "left" comand ????

    Hi
    I've uploaded
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    01-04-2010
    Location
    Amsterdam, Netherland
    MS-Off Ver
    Excel 2003
    Posts
    43

    Thumbs up Re: Combination of "IF" and "left" comand ????

    Problem solved !!!!!!!!1

    Thank you .


+ 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