+ Reply to Thread
Results 1 to 9 of 9

"Subtracting" text in column B from column A

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question "Subtracting" text in column B from column A

    Having a heck of a time figuring this one out, and it seems so simple.

    I have data in column B that I would like to 'subtract' from column A. For example....

    Column A:
    Apple
    Banana
    Carrot
    Durian
    Eggplant


    Column B:
    Apple
    Durian
    Eggplant

    ....the result would be:

    Column C:
    Banana
    Carrot


    Instead of 'subtracting,' it could be seen as finding duplicates and deleting both copies, too. Do I need to use a formula of some kind? A filter? Either way, I've tried and I'm just confused! Any explanation would be appreciated (and layman's terms too, please). Thank you!

  2. #2
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: "Subtracting" text in column B from column A

    One thing you can do (maybe not the "best" solution) is to put the following in Column C and then filter out the blanks.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: "Subtracting" text in column B from column A

    with helper col d
    Attached Files Attached Files
    Last edited by martindwilson; 07-17-2012 at 06:30 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: "Subtracting" text in column B from column A

    Nice solution Martin!

  5. #5
    Registered User
    Join Date
    07-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: "Subtracting" text in column B from column A

    I either do not know how to properly insert these formulas, and/or they do not work for me.

    Instructions, anyone...? I usually stay away from Excel formulas whenever possible, so I am a total novice.

    For reference, Column A is 501 rows, and Column B is 295 rows. (Once again, I need to subtract B from A and have the new list populate in Column C. Cells contain both text and numerical data.)

    Thanks-!

  6. #6
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: "Subtracting" text in column B from column A

    Copy cells C1 and D1 down to row 501.

  7. #7
    Registered User
    Join Date
    07-17-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: "Subtracting" text in column B from column A

    Great! Looks like I got it.

    ...but what is the meaning of Column D? I realize the numbers listed are the same as their row number, but not all of the rows have a number listed. Just curious.

  8. #8
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: "Subtracting" text in column B from column A

    If column D is blank, it means that the item in column A is duplicated somewhere in column B. If column D contains a number, yes, that's the row identifying the item in column A that's NOT duplicated. Column C then uses column D to identify which items from column A to put on your short list.

  9. #9
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: "Subtracting" text in column B from column A

    in case you do not want to use a helper column, you can use the following, slightly complex, approach:

    EDIT: slight change in the formula to accommodate blank inputs.
    Last edited by icestationzbra; 07-20-2012 at 09:36 AM. Reason: update
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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