+ Reply to Thread
Results 1 to 9 of 9

Find, compare, write higher value - multiple columns and contitions

  1. #1
    Registered User
    Join Date
    01-26-2020
    Location
    Olomouc, Czech Republic
    MS-Off Ver
    Office 365
    Posts
    5

    Find, compare, write higher value - multiple columns and contitions

    Hi guys,
    lets say I have four columns, two with different sets of journal ISSN a two with their respective values, e.g.:

    ISSN 1 | Points 1 | ISSN 2 | Points 2
    0001-1234 | 100 | 0002-5678 | 110
    0002-5678 | 100 | 0001-1234 | 110

    My goal is to to find and write (in two new columns) ISSN with higer points or -if not matched by ISSN- write "no match" in first of those two new columns.

    Any help would be greatly appreciated, thank you!
    Attached Files Attached Files
    Last edited by Sinimus; 01-26-2020 at 04:08 AM. Reason: Added example xlsx

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,610

    Re: Find, compare, write higher value - multiple columns and contitions

    Administrative note

    Welcome to the forum

    missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Find, compare, write higher value - multiple columns and contitions

    Hi, a sample sheet always makes it easier for us to help you, but since this was such a small sample of data I thought I'd make it for you.

    In cell E2:
    Please Login or Register  to view this content.
    Edit: Sorry Pepe Le Mokko, I forgot to refresh before I posted. I missed your advice for Sinimus.
    Edit 2: Just saw your file now Sinimus, checking it out.
    Attached Files Attached Files
    Last edited by Beamernsw; 01-26-2020 at 04:13 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    606

    Re: Find, compare, write higher value - multiple columns and contitions

    OK, I see now. I thought it sounded too easy
    I won't have time to sort this until tomorrow, I'm sure someone else will jump in before I get back.

    Three questions though...If there is a match with one column but not the other, do you put the largest number for that matching ISSN or do you put "no match" (In other words, does "no match" mean BOTH ISSN's have no match).
    e.g. In row 6 00346861 has a match on row 18, yet 00280836 has no match.

    And secondly, where there is a match with one in another row, do you want that answer repeated on those lines as well?
    e.g. row 18 will also show the same as row 6 (but if the match in row 18 for 00018732 was higher points it would be shown but it is actually less).

    And thirdly, if the points for ISSN 1 and ISSN 2 are the same, which column has preference...meaning which one is listed.

    Edit: Added example and 1 more question
    Last edited by Beamernsw; 01-26-2020 at 04:44 AM.

  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,475

    Re: Find, compare, write higher value - multiple columns and contitions

    F2:

    =IFNA(VLOOKUP(B2,$D$2:$D$50,1,0),"No Match")

    G2:

    =IFNA(INDEX($A$2:$A$50,MATCH(F2,$B$2:$B$50,0)),"")

    H2:

    =IFNA(LOOKUP(INDEX($C$2:$C$50,MATCH(F2,$D$2:$D$50,0))-G2,{-5000,0,1},{"bigger than B","same","smaller than B"}),"not found")
    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.

  6. #6
    Registered User
    Join Date
    01-26-2020
    Location
    Olomouc, Czech Republic
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Find, compare, write higher value - multiple columns and contitions

    Yes, its not that simple.
    First answer - I would put higher points value only when there is match in ISSN columns (both ISSN columns have matched value). And secondly - yes, then we just remove duplicates.

    The case study is we got journals from two different databases - for each db we have for every journal some points from internal metrics. What we want to do is to compare those two dbs, find journal which are in both, compare their points and write higher value.
    Thank you kindly for your affords!

  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,475

    Re: Find, compare, write higher value - multiple columns and contitions

    Change G2 to this:

    =IFNA(MAX(INDEX($A$2:$A$50,MATCH(F2,$B$2:$B$50,0)),INDEX($C$2:$C$50,MATCH(F2,$D$2:$D$50,0))),"")

    and H2 to this:

    =IFNA(LOOKUP(INDEX($C$2:$C$50,MATCH(F2,$D$2:$D$50,0))-INDEX($A$2:$A$50,MATCH(F2,$B$2:$B$50,0)),{-5000,0,1},{"bigger than B","same","smaller than B"}),"not found")
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-26-2020
    Location
    Olomouc, Czech Republic
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Find, compare, write higher value - multiple columns and contitions

    Wow AliGW, that looks great! I wasnt even thinking about IFNA function. Im going to put it down to our 50k+ rows sheets.
    Thanks a million. And thanks to Beamernsw as well.

  9. #9
    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,475

    Re: Find, compare, write higher value - multiple columns and contitions

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

+ 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: 09-28-2016, 12:01 PM
  2. VBA Code to compare/match multiple columns in one sheet with multiple columns in another
    By cellsearch123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2016, 09:25 AM
  3. [SOLVED] Compare two columns and write which is existing in B in C Column
    By uday1969 in forum Excel General
    Replies: 5
    Last Post: 02-04-2015, 12:59 AM
  4. How to compare values and output the higher of the two?
    By a-man in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2014, 03:13 AM
  5. Replies: 5
    Last Post: 07-05-2011, 06:25 PM
  6. How do I write a VBA code in excel that will compare two columns .
    By PenelopeinCinci in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-14-2005, 01:06 PM
  7. create an excel formula with contitions
    By cuvi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-07-2005, 05: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