+ Reply to Thread
Results 1 to 11 of 11

If contains ,MX

  1. #1
    Registered User
    Join Date
    05-13-2011
    Location
    Oxford, Michigan
    MS-Off Ver
    Excel 2003
    Posts
    8

    If contains ,MX

    I have a spreadsheet with several travel markets around the world and on the same line it contains revenue for the market. I need to SUM the value of all travel to Mexico but the only way it's displayed in the report is by Guanajuato, MX-Raleigh/Durham, NC or Detroit, MI-Guanajuato, MX the only common item is , MX and it's always in colum D with a cell range of D2:D900

    How can I search out just , MX and have the revenue from cells E2:E9000 sum on another page?
    Attached Files Attached Files
    Last edited by RobB11; 05-23-2011 at 09:29 AM. Reason: Added a basic example

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

    Re: If contains ,MX

    Welcome to the forum.
    Upload a small sample file (with no personal data).

  3. #3
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: If contains ,MX

    May be with sumproduct. See the attachment.
    Attached Files Attached Files
    regards

    johnjohns

    When you are not sure where to go, every road takes you there!

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: If contains ,MX

    Better with SUMIF:

    =SUMIF(DATA!D:D, "*"&A10&"*", DATA!E:E)

    changin only DATA!E:E for other columns.

  5. #5
    Registered User
    Join Date
    05-13-2011
    Location
    Oxford, Michigan
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If contains ,MX

    zbor,

    That worked when pulling, MX however I discovered that there is 1 additional piece I need.

    It has to identify North America-North America first (that's where we dumb the Mexico info) then has to identify, MX so I can separate it form the rest of North America (we treat it differently).

    I have attached a new example with the added info.
    Attached Files Attached Files

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

    Re: If contains ,MX

    So you want a total number of flights that have ", MX" in column D but do not have "North America-North America" in column B?

    If so, in B5 use this:
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: If contains ,MX

    Hi

    I would just add an extra column at the end of the data with a formula

    =IF(ISNUMBER(FIND("MX",D2)),1,0)

    Then turn the data into a List, by placing cursor within data and choosing Data>List>Create List

    A simple Pivot Table will then produce all the information you want. (see attached)
    Attached Files Attached Files
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  8. #8
    Registered User
    Join Date
    05-13-2011
    Location
    Oxford, Michigan
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If contains ,MX

    Sorry I want to find all of the lines that have both North America-North America in colum B and , MX in colum D. Then I need to be able to sum all of the flights in colum E, all in the same formula.

    The above equations did not work.

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

    Re: If contains ,MX

    If you want to go with the formula solution just change the "<>" to "=" in the formula I gave you.

  10. #10
    Registered User
    Join Date
    05-13-2011
    Location
    Oxford, Michigan
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If contains ,MX

    Thank you that worked!

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

    Re: If contains ,MX

    You're welcome.
    Don't forget to mark your thread as SOLVED (click FAQ at top of page for instructions).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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