+ Reply to Thread
Results 1 to 6 of 6

sumif with condition

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    sumif with condition

    Hi,

    I'm trying to do a sumifs with a condition. See attached file. Tab 1 raw data. Tab 2 expected result


    Tab 2:

    Column B = should be sum if (column a & column c match). However also, if value in column c contains "truck" or "trucks - toyota" etc, then do a sum if.

    See 2nd Tab for expected outcome.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,079

    Re: sumif with condition

    1. Column A in both spreadsheets is "Accts"
    Column C in Tab 1 is "Cost", Column C in Tab 2 is "Type"

    Therefore column a and c will NEVER match.
    They're three different things.

    2. What does "etc" mean ? It means NOTHING to Excel.
    Provide a list of what the Type should be
    "truck" or "trucks - toyota" or..........................?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,936

    Re: sumif with condition

    Try this in B2 on Tab2 and copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Not sure how you arrived at 350 as an expected figure for ABC123 / Truck... I make it 300, unless I've misunderstood the requirement.

    BSB

  4. #4
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: sumif with condition

    Yes this worked perfectly. Thanks very much - Appreciated. I assume left (c2,3)&"*"...is saying in plain english...in cell c2, count first 3 characters and use that as the root value to match & anything that comes after it hence &"*", also count those values, correct?
    Last edited by VegasL; 08-30-2018 at 12:53 AM.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,658

    Re: sumif with condition

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,936

    Re: sumif with condition

    No problem, happy to help.

    Quote Originally Posted by VegasL View Post
    I assume left (c2,3)&"*"...is saying in plain english...in cell c2, count first 3 characters and use that as the root value to match & anything that comes after it hence &"*", also count those values, correct?
    Correct indeed. It's looking for the first 3 characters in C2, adding a wildcard and then searching for any match for that in ColB on Tab1.
    It's not a perfect solution in all situations, but it works for the sample data you provided.

    BSB

+ 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. SUMIF If More Than One Condition Is True
    By Leevi90 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-13-2014, 08:37 PM
  2. SUMIF with condition
    By kisboros in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-27-2013, 03:37 PM
  3. How to next condition to do Sumif
    By pph2113 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2013, 02:16 PM
  4. If and sumif condition formula
    By santanuKD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2011, 03:27 AM
  5. SumIf with more than one condition
    By qwyz in forum Excel General
    Replies: 5
    Last Post: 05-12-2009, 10:02 AM
  6. SUMIF with Condition
    By Isacael in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2009, 07:37 PM
  7. condition: SUMIF
    By jeremy via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-12-2005, 09:05 PM

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