+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Return a value if two columns have the same text

  1. #1
    Registered User
    Join Date
    12-08-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Return a value if two columns have the same text

    I have a large worksheet with 4 columns, like this:

    john cups blue 2
    john cups red 1
    john cups all 3
    john bowls green 4
    john bowls yellow 1
    john bowls all 5
    john all all 8


    This report gives me customer name, the category of product, the unique product within the category, the quantity of each unique product sold and the total for all products sold to each customer, first by product category, then by all products together.

    The format continues for each successive customer.

    The entries in the category and product columns are pre-set, and the only thing that defines the total row I want is the fact that the word "all" appears twice in that row (all categories and all products)

    Is there a way to pull out just the total lines (all and all)? I tried using pivot tables but since there is so much repetition in the worksheet, it's not sortable. Is there some sort of "if all appears twice, then tell me the number in the next column" method to solve this.

    Sorry if I've explained this poorly...thanks.
    Last edited by nanoroboto; 01-21-2011 at 03:52 PM.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Return a value if two columns have the same text

    Do you want a Sum of those numbers when all appears twice or a Count?

    Depending on your need you can try SUMIFS or COUNTIFS

  3. #3
    Registered User
    Join Date
    12-08-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Return a value if two columns have the same text

    I would like to have a report that says, "John Bought 8 things total" "Steve bought x things total" etc. That's a sum right?

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Return a value if two columns have the same text

    Not sure how you're using this but something like:

    =SUMIFS(D:D,A:A,"John",B:B,"all",C:C,"all")

    would give you a result of 8 if in column D there was an 8, col A contained "John", and both B and C contained "all"

    and it would add to the 8 if the same conditions were met elsewhere in the table

    so to get "John Bought 8 things total" place John in a cell (say G1)

    in another cell place this:

    =G1&" bought "&SUMIFS(D:D,A:A,G1,B:B,"all",C:C,"all")&" things total"
    Last edited by Cutter; 01-21-2011 at 04:11 PM.

  5. #5
    Registered User
    Join Date
    12-08-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Return a value if two columns have the same text

    I'll try it...so the first sumifs is returning what's in column D where A shows john, B shows all, and C shows all...that's great, thanks!

+ 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