+ Reply to Thread
Results 1 to 15 of 15

IF formula

  1. #1
    Registered User
    Join Date
    10-02-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    40

    IF formula

    I would like to get the following result, within an excel sheet where I have 4 different columns:
    If A1=C* then B1=D*
    * means that the formula runs all over the C and D columns to find the corresponding matching data.

    Can someone please help me with that?
    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: IF formula

    Welcome to the forum!
    Could you try upload a sample spreadsheet with expected result so that members can help out?



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  3. #3
    Registered User
    Join Date
    10-02-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: IF formula

    Yes of course!
    I have uploaded a simple example... I would like that in B1 I get the D4 value (because A1=C4) and if there are no matching values between A and C column then the B cell remains blank.
    Thanks!
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: IF formula

    Great, try this formula in B2 and copy down to B5. You'll get only matched result in B5=D3 because you've a trailing space for A1:A3

    Formula: copy to clipboard
    Please Login or Register  to view this content.




    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  5. #5
    Registered User
    Join Date
    10-02-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: IF formula

    Thank you for the reply!

    But I think the problem is not solved... I have uploaded once more the file. And the question remains the same: How can I have, for example, in B1 the D4 value (because A1=C4) and if there are no matching values between A and C column then the B cell remains blank?

    The previous formula didn't work :-/
    Attached Files Attached Files

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: IF formula

    Hi,

    Firstly, your new attachment seems to have moved everything up one row. Secondly, you appear to have extra spaces in your entries in column A, which will need to be removed for the previous solution to work.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  7. #7
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: IF formula

    Thanks XOR LX for the explanation

    Hi athinaida, if you've already removed the trailing space in you data and the formula still not working as expected could you explain in more details?



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  8. #8
    Registered User
    Join Date
    10-02-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: IF formula

    Hello,

    I'm sorry but the formula didn't work at first because it shows an error...
    Capture.PNG

    I corrected the document, because the first blank row was not needed.
    Concerning the extra spaces, i can't see what you're referring to...

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: IF formula

    As an example, your entry of 21 0214 in column A is actually 21 0214? where the ? here represents a single space.

    Since, however, the equivalent entry in column C does not contain this extra space, and since you are attempting to match the two, the formula will fail in this case.

    Regards

  10. #10
    Registered User
    Join Date
    10-02-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: IF formula

    Good morning,

    I'm sorry. I deleted the "empty space" which seemed to be included (even if I couldn't see that) and formula still doesn't work... I don't really know which is the problem.

    I have uploaded a new "test3" file. Maybe IF formula is not the correct one to give me the results I need... I'll describe once more what I'm looking for: how can I have automatically in column i.e. Bx the data of column Dx, if there is an equivalent value in A and C column and so on... If Ax has no match in column C, then I should get a zero.

    Any ideas?
    Thanks in advance.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: IF formula

    Hi athinaida, just tweak the formula earlier in B1 and copy down till B6.

    Formula: copy to clipboard
    Please Login or Register  to view this content.




    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  12. #12
    Registered User
    Join Date
    10-02-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: IF formula

    Hello Alvin,

    thanks for your solution.
    I would really appreciate it if someone could upload my fine along with the formula. I copy-paste it and still doesn't work. Something's really wrong with my excel, unbelievable!

  13. #13
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: IF formula

    Here's the attachment, hope it works on your machine



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-02-2013
    Location
    London, UK
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: IF formula

    Yes it does! Thanks a lot!!!
    (still can't understand what was the problem before... anyway thanks!)

  15. #15
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: IF formula

    Thank you for the feedback, you're welcome



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

+ 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. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 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