+ Reply to Thread
Results 1 to 15 of 15

Compare 2 work sheet cells and populate based on results

Hybrid View

  1. #1
    Registered User
    Join Date
    05-08-2018
    Location
    Chennai
    MS-Off Ver
    365
    Posts
    34

    Compare 2 work sheet cells and populate based on results

    Can some one help me with simple formula to do below job for me?
    I have 2 work sheets

    Work sheet name : Claims. This has columns A till I

    How to populate I2 value

    When Cell A2 has value "Krish" or "Jacks", We need to apply below formula in I2
    Take cell H2 value in this Claims work sheet, Compare with cell A1 value in another work sheet called Reference
    If the values match, take C2 value in Reference work sheet and populate value in I2 of Claims work sheet
    If the value does not match, populate as "Offshore" in I2 of Claims work sheet
    When Cell A2 does not have value "Krish" or "Jacks", We need to mention "no match"
    Attached Files Attached Files
    Last edited by marimuthuravi; 06-01-2018 at 03:06 AM. Reason: title change

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,473

    Re: Need help on excel formula

    Welcome to the forum! Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No help to be offered, please, until the OP complies with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-08-2018
    Location
    Chennai
    MS-Off Ver
    365
    Posts
    34

    Re: Need help on excel formula

    hi..i updated title

  4. #4
    Forum Expert
    Join Date
    11-26-2013
    Location
    Colac, Victoria, Australia
    MS-Off Ver
    Excel 2016
    Posts
    1,309

    Re: Need help on excel formula

    Lots of confusion here!

    Your formula in I2 is refering to a sheet named ILC data which doesn't exist. If you remove all reference to that sheet, the formula returns "Offshore" on nearly every row.

    I can't work out what the rest of the formula is trying to do! Reference sheet only has two rows!

    Surely you need a VLOOKUP or MATCH/INDEX formula to get data from this sheet. I can't make sense of the second IF statement.

    Regards David

    I hope this helps, please let me know!

    Regards,

    David

    If this has been helpful
    - Please click on the *Add Reputation button at the bottom left.

    Please mark your thread as SOLVED:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,473

    Re: Compare 2 work sheet cells and populate based on results

    Better - thank you.

  6. #6
    Registered User
    Join Date
    04-14-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Compare 2 work sheet cells and populate based on results

    The error #NAME? from your sample Excel because you are referring to a sheets is not in your worksheet which is "ILC data!A2"

    =IF(OR(ILC data!A2="Krish",ILC data!A2="Jacks"),IF(ILC data!H2=Reference!A1,Reference!C2,"Offshore"),"")


    So I modify the formula as per below that would give you the result as "Offshore" or "no match"

    =IF(OR(A18="Krish",A18="Jacks"),IF(H18=Reference!A17,Reference!C18,"Offshore"),"no match")

    Regards,
    Rev12




    If helpful to you;
    - Please click on the *Add Reputation button at the bottom left.

    Then mark your thread as SOLVED if meets your need:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".
    Attached Files Attached Files
    Last edited by Rev12; 06-01-2018 at 09:06 AM.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,473

    Re: Compare 2 work sheet cells and populate based on results

    Quote Originally Posted by Rev12 View Post
    Please can you see on the attached Excel, if this is what your result to be.

    Regards,
    Rev12




    If helpful to you;
    - Please click on the *Add Reputation button at the bottom left.

    Then mark your thread as SOLVED if meets your need:
    - Click Thread Tools above your first post, select "Mark your thread as Solved".


    Sorry for off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,768

    Re: Compare 2 work sheet cells and populate based on results

    But my expectation is that we should always start looking from A1 and C1 for H2, H3,H4...

    A1 is a heading (as is C1) and H2 is an Employee Number .....and the only sensible match is between Employee numbers in A and H

    So I do not understand what you mean by the above: nothing will ever match Reference!A1

  9. #9
    Registered User
    Join Date
    04-14-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Compare 2 work sheet cells and populate based on results

    I agree and thanks.

  10. #10
    Registered User
    Join Date
    05-08-2018
    Location
    Chennai
    MS-Off Ver
    365
    Posts
    34

    Re: Compare 2 work sheet cells and populate based on results

    Thanks. I changed the excel a little bit. See the rows in RED color in claims sheet. Why do i get "offshore" for Row no 18,19 in Claims sheet when there is a matching emp no in Reference sheet. Ideally for Row no 18,19 in Claims sheet, i should see "Landed"
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,768

    Re: Compare 2 work sheet cells and populate based on results

    In I2

    =IF(OR(A2="Krish",A2="Jacks"),IFERROR(INDEX(Reference!$C$2:$C$100,MATCH($H2,Reference!$A$2:$A$100,0)),"Offshore"),"")

    Copy down

  12. #12
    Registered User
    Join Date
    05-08-2018
    Location
    Chennai
    MS-Off Ver
    365
    Posts
    34

    Re: Compare 2 work sheet cells and populate based on results

    Thanks a lot..It worked now

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,768

    Re: Compare 2 work sheet cells and populate based on results

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  14. #14
    Registered User
    Join Date
    05-08-2018
    Location
    Chennai
    MS-Off Ver
    365
    Posts
    34

    Re: Compare 2 work sheet cells and populate based on results

    Thanks..meets my expectation to some extent but not fully.Your formula reads as below
    =IF(OR(A2="Krish",A2="Jacks"),IF(H2=Reference!A1,Reference!C2,"Offshore"),"")

    Issue is the statement Reference!A1,Reference!C2, in formula keeps increasing to next row. For example.
    For H2
    Reference!A2,Reference!C2,
    For H3
    Reference!A3,Reference!C3,

    But my expectation is that we should always start looking from A1 and C1 for H2, H3,H4...

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,473

    Re: Compare 2 work sheet cells and populate based on results

    If you agree, please add the detail requested to post #6 above. Thanks.

+ 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] VBA, User-defined formula argument referring to cell value calculated by Excel formula
    By ARAGORN II in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2017, 01:57 PM
  2. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  3. Replies: 10
    Last Post: 12-16-2015, 03:16 PM
  4. Replies: 2
    Last Post: 03-21-2014, 11:43 AM
  5. Macro: Applying formula to multiple cells in excel (formula editing)
    By city in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2012, 06:41 AM
  6. Replies: 0
    Last Post: 03-19-2012, 07:32 PM
  7. Replies: 1
    Last Post: 03-04-2012, 12:03 AM

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