+ Reply to Thread
Results 1 to 26 of 26

Formula for Comparing Two Columns of Emails

  1. #1
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Formula for Comparing Two Columns of Emails

    Hi,

    I know I have seen this formula before, but I cannot for the life of me find it or remember it and hoping someone here can help. I will explain what I need the best I can.

    I have column A with emails that I have listed as "Bad" or "don't send" and I have pasted in Column B a new list of emails that I want to send out, but I need to make sure none of the emails in column A are in the list of Column B. so what I am looking for is for Column B, new emails, be compared against master email list in Column A and put net results in Column C. That way I can then use those emails and not worry that I would send another email to someone that has unsubscribed.

    Column A = Master Unsubscribed List of Emails

    Column B = New email list I want to send out

    Column C = Net new email list making sure no emails from column B are in Column A.

    Thanks for your help!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    It this what you had in mind?

    Data Range
    A
    B
    C
    1
    2
    Email1
    Email1
    Email2
    3
    Email3
    Email2
    Email5
    4
    Email4
    Email3
    Email6
    5
    Email7
    Email4
    Email8
    6
    Email5
    7
    Email6
    8
    Email7
    9
    Email8
    10


    This array formula** entered in C2:

    =IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$9,A$2:A$5,0)),ROW(B$2:B$9)),ROWS(C$2:C2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    That might be the trick. I am on a mac and it says to use the "key"combinations, not sure if they are the same on the mac, but I have tried several combinations but they don't paste anything there. I can paste normally but not using the key combinations.
    If I have over a 1000 names, what is the simplest way to make this work for the entire column? Do I just need to scroll down once it is in the first column C cell?

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    I think the key combo for a Mac is CMD-Return.

  5. #5
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    Hmm, nothing. When I click on command return, it just moves to the next cell below without putting anything in.

    I have my information starting in row 2 as I have a heading, so I would be starting in Column C row 2 for this formula. Am I doing something wrong? I am copying your formula and then hit command return in column C row 2.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    Sorry, I don't have any experience with Mac or Excel on a Mac.

    Let me see if I can get some attention to this.

  7. #7
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    Thank you. I appreciate your willingness to help. I know the commands should be about the same, but I guess not on this one.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    I posted this in our "We need help" section:

    https://www.excelforum.com/showthread.php?p=4487575

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Formula for Comparing Two Columns of Emails

    Hi Rack38

    Google on "enter array formula excel 2011 mac"...you'll find the Key Combination.

    Select the range, press CONTROL + U and then press ⌘ + RETURN . This doesn't seem to work in Mac Excel 2016. After a bit of digging, it looks like the key combination for entering the array formula has changed from ⌘ + RETURN to CTRL + SHIFT + RETURN .Oct 28, 2014
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  10. #10
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    Thank you for adding your insights, unfortunately, it is still not working. I have even searched as suggested. One question I did have, when you say "select the range" what cells am I supposed to be selecting? Column A, B and C or just A and B or just C? Sorry . . .

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    "Select the range" doesn't apply in this case.

    That's used when you want to enter a formula in an array of cells.

    You just want to array enter the formula in a single cell then drag copy.

  12. #12
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    Okay, I have tried that with only the first cell giving me an email back. The rest of the cells show a green icon in the left but no emails.

    I have included a basic file as my test file in hopes you can replicate what I need to do. If I paste the code: =IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$9,A$2:A$5,0)),ROW(B$2:B$9)),ROWS(C$2:C2))),"")

    in cell c2, and then drag copy, is that the process? I am not getting anything yet.

    Thanks in advance again for your help in this matter.
    Attached Files Attached Files

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    Quote Originally Posted by Rack38 View Post
    in cell c2, and then drag copy, is that the process?
    Yes, but the formula needs to be array entered.

    In a Windows based machine array entry is using the key combo of CTRL+SHIFT+ENTER.

    However, you're using a Mac and we haven't found/don't know the correct key combo for that platform.

    When done properly, Excel will enclose the formula in squiggly brackets { }. You'll see this in the formula bar, at least, on the Windows platform.
    Last edited by Tony Valko; 09-23-2016 at 04:31 PM.

  14. #14
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Formula for Comparing Two Columns of Emails

    Hi Tony...my Mac is down at the moment but my research indicates this...

    Select the range, press CONTROL + U and then press ⌘ + RETURN . This doesn't seem to work in Mac Excel 2016. After a bit of digging, it looks like the key combination for entering the array formula has changed from ⌘ + RETURN to CTRL + SHIFT + RETURN .

  15. #15
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    Okay, I have opened this on a windows machine using excel 2013. This is what I have tried and failed so far, still.

    1. copy =IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$9,A$2:A$5,0)),ROW(B$2:B$9)),ROWS(C$2:C2))),"") to clipboard

    2. click on the C2 cell and click CTRL+SHIFT+ENTER.

    3. Nothing happens

    2nd attempt.

    1. Copy

    2. Paste in C2 and then drag copy down. The first cell has an email in it, but the rest of the C cells don't show anything. If I click on a cell it will show me the formula but nothing shows up

    What am I doing wrong? It feel like I am simply not clicking the right button or cell . . .

  16. #16
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    Quote Originally Posted by Rack38 View Post
    click on the C2 cell and click CTRL+SHIFT+ENTER.
    You don't click CTRL+SHIFT+ENTER.

    Type the formula:

    =IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$9,A$2:A$5,0)),ROW(B$2:B$9)),ROWS(C$2:C2))),"")

    Once you've typed the closing ) hold down both the CTRL key and the SHIFT key then press ENTER.

    When you release the CTRL and SHIFT keys Excel will place the squiggly brackets { } around the formula. If done properly you'll see this in the formula bar:

    {=IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$9,A$2:A$5,0)),ROW(B$2:B$9)),ROWS(C$2:C2))),"")}

    You can't just type these brackets in, you *must* use the key combo to produce them. Also, anytime you edit an array formula it *must* be re-entered as an array using the key combo.

  17. #17
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Formula for Comparing Two Columns of Emails

    If you're using XL2010+, here's a formula that doesn't require array enter..

    =IFERROR(INDEX($B$2:$B$9,AGGREGATE(15,6,1/(1/(ISNA(MATCH($B$2:$B$9,$A$2:$A$5,0))*(ROW($B$2:$B$9)-1))),ROWS(C$2:C2))),"")

  18. #18
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    Okay, it seems much better. Just two more questions and then I'll leave you all alone.

    1. In Column A I have 850 rows. Column B I have 13000 rows. I am assuming in the formula I need to change the B$9 to B$13000 in three instances? What about Column A, do I need to adjust anything in the formula to accommodate the 850 rows?

    2. Is there a quicker way of drag copy the formula to all 13000 rows? Or do I have to just drag to the bottom?

    Thanks again

  19. #19
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Formula for Comparing Two Columns of Emails

    Answer of 1st question :
    Change $A$2:$A$5 to $A$9:$A$850

    Answer of 2nd question :
    As I have no idea about MAC, I am not sure whether this will work or not there. You may try. Say you have entered the formula in C9, Then copy C9. Now Select C13000, then Ctrl+Shift+Up Arrow. This will select all the cells from C13000 to C2. Now paste the formula.

  20. #20
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    Thank you very much. What does the $A$9 represent? Meaning, how do know when to change it to what?

  21. #21
    Registered User
    Join Date
    09-23-2016
    Location
    United States
    MS-Off Ver
    14.6.8
    Posts
    10

    Re: Formula for Comparing Two Columns of Emails

    One more thing I wanted to bring up or ask, when I followed the instructions "Say you have entered the formula in C9, Then copy C9. Now Select C13000, then Ctrl+Shift+Up Arrow. This will select all the cells from C13000 to C2. Now paste the formula."

    I did this, but most of the cells in column C paste in the very first cell I copied. Not in all, but 80% of them. It seems if I go really slow it takes, but if I try and do the entire column it fills in the column C cells with the first Cell from the formula. Any idea? Does it just take forever to do this? I have both a mac and windows so I am working on both and get the same result from either.

  22. #22
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Formula for Comparing Two Columns of Emails

    $A$9 represent your 1st cell of column A from where your data started and $A$850 is the last cell.

  23. #23
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula for Comparing Two Columns of Emails

    Quote Originally Posted by Rack38 View Post
    Does it just take forever to do this? I have both a mac and windows so I am working on both and get the same result from either.
    If you're copying the formula to 13k rows it'll take a "few" seconds to finish calculating.

    The AGGREGATE version is slower to calculate compared to the array version.

  24. #24
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Formula for Comparing Two Columns of Emails

    As you are using array formulas on 13000 rows so it will take some time to calculate. One more thing I made a typo on my 1st post. It will be "from C13000 to C9".

  25. #25
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Formula for Comparing Two Columns of Emails

    @Rack38,

    If you are still having difficulties, you might find this approach is easier and quicker, as it doesn't use array formulae, but it does use column C as a helper column (coloured blue).

    I've taken your file from Post #12 and put this formula in C2:

    =IF(B2="","-",IF(COUNTIF(A:A,B2),"-",MAX(C$1:C1)+1))

    This can be copied down to the bottom of the list that you have in column B, or even beyond - the hyphens will indicate where the formula is active. This sets up a unique list of sequential numbers for those addresses which do not appear in the list in column A. Then I used this formula in D2:

    =IF(ROWS($1:1)>MAX(C:C),"",INDEX(B:B,MATCH(ROWS($1:1),C:C,0)))

    and this can be copied down until you start to get blanks (I've copied to row 24 in the example file) to give you the list of acceptable email addresses.

    No need to bother about how much data you have and adjusting the formulae to suit, and both of the formulae are normally-entered.

    Hope this helps.

    Pete
    Attached Files Attached Files

  26. #26
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Formula for Comparing Two Columns of Emails

    I thought the shortcut for an Array formula (on a Mac) was
    ^ {up arrow} {Return}

    thats Tilde, the up arrow and Return Key pressed together.
    If someone has helped you then please add to their Reputation

+ 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] Formula comparing two columns and adding results
    By snakesbee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-23-2015, 12:54 PM
  2. comparing 2 time columns with in array formula
    By Spreadsheetdaunting in forum Excel General
    Replies: 1
    Last Post: 07-23-2014, 10:36 PM
  3. [SOLVED] Need formula for comparing columns?
    By Miss Molko in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 08:46 AM
  4. Comparing two columns for duplicates formula?
    By istharbgl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-18-2013, 09:32 AM
  5. [SOLVED] Comparing Two Columns of Emails / EXACT doesn't work
    By SpeakingPeace in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-23-2013, 04:28 PM
  6. [SOLVED] Help w/ countif formula in comparing the information in two different columns
    By scyllanbay in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2012, 11:58 AM
  7. [SOLVED] Help w/ countif formula in comparing the information in two different columns
    By scyllanbay in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-13-2012, 11:34 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