+ Reply to Thread
Results 1 to 5 of 5

If function comparison

  1. #1
    Registered User
    Join Date
    04-06-2020
    Location
    Boston
    MS-Off Ver
    Excel 2016
    Posts
    3

    If function comparison

    Hi,

    In the file attached, there is the Group column (B) and Name column (C) both of which are related to each other. I need a formula that would return a value under certain conditions of what is inside columns B and C.

    If e.g. the column B value is USA, but in column C we have "wood and metal" for group USA, then I need column D (Result) return "USA", same rule would apply for China. If I am trying to to get a result from groups - France, Greece, and Italy; then I want to return what is in Column C (oil,metal, TV) into column D


    Group Name Result
    USA wood
    USA metal
    France oil
    Greece metal
    Italy TV
    Italy TV
    Italy TV
    China cotton
    China fruit
    China paper
    China engine


    P.S. s
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: If function comparison

    You dont show what your expected outcome is?

    Maybe something like...
    =if(and(B2="USA"mC2="Wood"),"USA","")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: If function comparison

    Hi,
    I created in column A column a combination of columns B & C
    Then in column D (result) I applied the following formula to extract the country name:

    =+LEFT($A2,FIND("_",$A2,1)-1)

    This formula can be copied down to entire column.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,940

    Re: If function comparison

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new, I will do it for you this time.)

    https://www.mrexcel.com/board/thread...rison.1130835/
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    04-06-2020
    Location
    Boston
    MS-Off Ver
    Excel 2016
    Posts
    3

    Re: If function comparison

    Thank you very much!

+ 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. Replies: 8
    Last Post: 10-14-2015, 11:58 AM
  2. Using comparison operators (<=) in IF Function
    By Sweetypie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2012, 10:19 AM
  3. Comparison Function
    By NickSlash in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2012, 03:35 AM
  4. Text Comparison - Function Required
    By mushtaque_asghar in forum Excel General
    Replies: 1
    Last Post: 07-03-2009, 06:36 AM
  5. sheet comparison using VB function
    By maverick3483 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2009, 01:42 AM
  6. [SOLVED] Comparison Function
    By DifficultyInExcel-ing in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2006, 12:25 PM
  7. Comparison Function
    By Michael in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-22-2005, 08:06 PM

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.6.0 RC 1