+ Reply to Thread
Results 1 to 10 of 10

Compare to Columns - Formula

  1. #1
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Compare to Columns - Formula

    I have 4 Columns : A, B,C,D
    A B C D
    01 Text134 01 Text134
    02 Text256 01,02,101 Text134
    Text256
    Text784
    03 101,01 Text784
    Text134
    04 Text123 14,01
    14 Text893 02
    101 Text784 02,01

    Values in Column C are from Column A
    I want in Column D to say : If C=A say B

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Compare to Columns - Formula

    Do you mean...

    =IF(C2=A2,B2,"")
    HTH
    Regards, Jeff

  3. #3
    Forum Contributor
    Join Date
    07-06-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Compare to Columns - Formula

    can you attached a sample of spreadsheet with desire result.

    From the way you describe seems like what jeffrey have provided.

  4. #4
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Compare to Columns - Formula

    My first post, It didn't look how I was hopping !
    I want the results in D like "Alt Enter" not in same row separated by ,
    Attached Files Attached Files

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Compare to Columns - Formula

    If you have the subscription version of Excel 2016 (I don't have that so I can't test this) this should work.

    It is good to use a helper column in column F with this formula. Enter in F2 and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then this formula will need to be array entered in G2 and filled down. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you do not have the subscription version then this requires a User Defined Function (VBA).

    If that is the case let us know. It requires posting more instructions, a different formula and additional code.
    Dave

  6. #6
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Compare to Columns - Formula

    I have attached the file with the formulas.
    I can not make it work
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Compare to Columns - Formula

    Column D is DESIRED result.
    A,B are given.
    When I Enter 1 in C2, in D2 should be B2 (because 1 is defined in A2 to be B2)
    When I Enter 1,2 in C3 in D3 should be B2,B3
    ...

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Compare to Columns - Formula

    OK. My best guess is that you do not have a subscription 2016. In that case you are probably getting #NAME? errors.

    Use the same helper column as before.

    The following VBA code for a User Defined Function called Concatall is already installed in the attached. It was written by a forum member tigeravatar. If you need to reuse it elsewhere find instructions for installation following this code:

    Then the formula is array entered in G2 and filled down. I already formatted to 'Wrap text'. Otherwise it will all be one line in the cells.

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


    Please Login or Register  to view this content.


    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the code into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Compare to Columns - Formula

    I have 2016, I am trying to make your formula work.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Compare to Columns - Formula

    TEXTJOIN is not available in all SKUs of Excel 2016. That needs to be a subscription (2016 or Office 365). If you don't pay a monthly/annual fee you do not have subscription.

    Have you tried the VBA solution yet? It sounds like that is what you are going need.

+ 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: 6
    Last Post: 09-21-2016, 04:21 PM
  2. [SOLVED] Formula to compare 2 columns for differences
    By Chris McGlothen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2016, 01:41 PM
  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. [SOLVED] What formula to use to compare two columns
    By weezie641 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2014, 09:07 AM
  5. Replies: 6
    Last Post: 05-30-2013, 04:58 PM
  6. Please help - formula to compare columns
    By ejsp in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-01-2006, 05:43 AM
  7. [SOLVED] Formula needed to compare columns
    By VP in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 09-08-2005, 04:05 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