+ Reply to Thread
Results 1 to 8 of 8

Excel Formula to compare multiple columns

  1. #1
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Cool Excel Formula to compare multiple columns

    Hello Again,

    Need help in comparing multiple columns and get the result as showing the attachment.

    Excel formula need to check the following:-

    - If the column D values is matching column I. In case of not matching the result in column N will not Description is Not Matching.
    - If the column E values is matching column L. In case of not matching the result in column N will not Type is Not Matching.
    - If the column E values is matching column L. In case of not matching the result in column N will not Type is Not Matching.
    - IF all the columns are not matching then the result will be in column N Description is Not Matching, Type is Not Matching, Date is Not Matching, Amount is Not Matching.
    - If all the columns are matching the result will be in column N is Correct

    Copy of expecting output result is attached for your reference.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Excel Formula to compare multiple columns

    Please try at N2

    =SUBSTITUTE(SUBSTITUTE(TRIM(REPT("Description_",D2<>I2)&" "&REPT("Type_",E2<>L2)&" "&REPT("Date_",G2<>--M2)&" "&REPT("Amount#_",F2<>K2)&REPT("Correct",AND(D2=I2,E2=L2,F2=K2,G2=--M2)))," ",", "),"_"," is Not Matching")
    Attached Files Attached Files

  3. #3
    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,929

    Re: Excel Formula to compare multiple columns

    Many of your sample answers are either not correct, or not totally correct (missing a non-match)

    Assuming criteria 3 is supposed to be G/M and not a repeat of E/L, try this...
    =IF(D2<>I2,"Description is not matching ","")&IF(E2<>L2,"Type is not matching ","")&IF(G2<>M2,"Date is not matching","correct")
    copied down
    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

  4. #4
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel Formula to compare multiple columns

    Thanks to both of you.

    I got an idea hot it works.

    But 1 question. How can i manage if the columns D, E, F & G are blanks or if columns H, I, K, L & M.

    Because it is possible that previous items is not exist on current list or current list don't have any previous records.

    In this case the result will be blank. can it be possible.

    I will try but incase if I fail.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Excel Formula to compare multiple columns

    It seems not match same row, but match any row?

    Quite strange and unreasonable data in manual output result, but give it a try:

    Please Login or Register  to view this content.
    with Output result is a list separated by "," if "not match", blank cell if "correct"
    Attached Files Attached Files
    Quang PT

  6. #6
    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,929

    Re: Excel Formula to compare multiple columns

    If 1 side of the pair is empty, then there will be no match, and the "NOT MATCH" part will trigger. You can avoid this by adding if(or(D2="",I2=""),"",....the rest of the formula

    Add that IF(OR() to each part

  7. #7
    Forum Contributor
    Join Date
    09-13-2013
    Location
    Saudi Arabia
    MS-Off Ver
    2010, 2013
    Posts
    192

    Re: Excel Formula to compare multiple columns

    This is good out the sites.

    You can expand your skills but experts helps.

    I did not expect this kind of professional possibilities.

    Thanks you very much to all of you. let me give a try if not i will get back to you.

    Topic mark to be closed.

  8. #8
    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,929

    Re: Excel Formula to compare multiple columns

    Thanks for the kind words - always appreciated, and thanks for the feedback

+ 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. Formula to compare multiple columns
    By RMikeal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2019, 12:18 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. Formula to Compare 2 Different Columns on a single Row Multiple Columns
    By dndgeez in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-05-2015, 04:11 AM
  4. Replies: 2
    Last Post: 01-25-2015, 08:32 AM
  5. [SOLVED] How to compare two columns in excel using VBA formula
    By Kuntal in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 11-23-2012, 02:42 AM
  6. [SOLVED] Excel Formula or tool to compare two columns of data
    By RBS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-14-2006, 02:00 PM
  7. Replies: 3
    Last Post: 04-07-2006, 11:45 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