+ Reply to Thread
Results 1 to 10 of 10

How do I SUMIF if column of valunes also contains text please?

  1. #1
    Registered User
    Join Date
    04-16-2025
    Location
    New Zealand
    MS-Off Ver
    Office 16
    Posts
    3

    How do I SUMIF if column of valunes also contains text please?

    Hi folks

    Long time user. first time caller.

    I have a vast spreadsheet measuring 26000+ rows and columns out to AL and everything has been working great for me for many years. But I was asked the other how may X co-worker Y had achieved.
    I used my SUMIF formula and it kept returning zero even though I know it should return a value.
    =SUMIF(E3:G43,"SL",E3:E43)

    And I think my issue is that some of my values aren't know so then I enter "unknown" in that row. And some of the X unknowns correspond to the Y co-worker. And I suspect but can't prove that is where my SUMIF is stumbling.
    I've formatted the column with values to be "Numbers" and that makes no difference. Unfortunately for me, I need the unknowns to be in that column.

    Therefore I suspect I need a SUMIF but with extra conditions included, yes?

    Thank you very much in advance for any new SUMIF tricks I am taught.




    Excel Example for SUMIF formula issue.xlsx

  2. #2
    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
    91,036

    Re: How do I SUMIF if column of valunes also contains text please?

    Welcome to the forum.

    Is it Excel 2016 that you are using?
    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.

  3. #3
    Forum Contributor
    Join Date
    07-18-2019
    Location
    iran
    MS-Off Ver
    2024
    Posts
    124

    Re: How do I SUMIF if column of valunes also contains text please?

    Quote Originally Posted by AliGW View Post
    Welcome to the forum.

    Is it Excel 2016 that you are using?
    hi
    No, its 2024

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,998

    Re: How do I SUMIF if column of valunes also contains text please?

    I3=sumproduct((f3:g26000="sl")*(n(+e3:e26000)))

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: How do I SUMIF if column of valunes also contains text please?

    Another option:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Registered User
    Join Date
    04-16-2025
    Location
    New Zealand
    MS-Off Ver
    Office 16
    Posts
    3

    Re: How do I SUMIF if column of valunes also contains text please?

    My hugest aplogies AliGW, yes, Office16
    Sorry

  7. #7
    Registered User
    Join Date
    04-16-2025
    Location
    New Zealand
    MS-Off Ver
    Office 16
    Posts
    3

    Re: How do I SUMIF if column of valunes also contains text please?

    Thank you very very much Caracalla.
    I would never have found what I was looking for continuing with SUMIF when what I actually needed was SUMPRODUCT.
    I truly appreciate you.

    Ciao
    Stu

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,489

    Re: How do I SUMIF if column of valunes also contains text please?

    Thanks for the rep.

    Yes, I was hoping that you might have upgraded ... and habib100 seemed to be running interference. Not sure why?

    Glad you have a solution.

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,726

    Re: How do I SUMIF if column of valunes also contains text please?

    Quote Originally Posted by StuLeslie View Post
    And I think my issue is that some of my values aren't know so then I enter "unknown" in that row. And some of the X unknowns correspond to the Y co-worker. And I suspect but can't prove that is where my SUMIF is stumbling.
    SUMIF can cope fine with text in the sum column, it just ignores it....but if you are trying to sum column E when F or G is = "SL" then that's not going to work because SUMIF works on a "one to one" basis, i.e. the sum range and the criteria range need to be the same size and shape

    When you use this formula

    =SUMIF(E3:G43,"SL",E3:E43)

    then excel implicitly changes the sum range to be the same size as the criteria range, so your formula is effectively this

    =SUMIF(E3:G43,"SL",E3:G43)

    That will always return zero whatever your data because no cell can be both = "SL" and a number

    This formula works to check column F for "SL" and sum column E

    =SUMIF(F3:F43,"SL",E3:E43)

    but if you need to check both columns F and G for "SL" you could use two SUMIF functions like this

    =SUMIF(F3:F43,"SL",E3:E43)+SUMIF(G3:G43,"SL",E3:E43)

    ....although that will double count if "SL" is shown twice in one row

    CARACALLA's suggested formula will also double count so gives the same result as my two SUMIFs above. If you only want to sum any row once, even if there are two "SL"s then this version will do that

    =SUMPRODUCT(((F3:F43="SL")+(G3:G43="SL")>0)+0,E3:E43)

    and so will this "array formula" version

    =SUM(IF((F3:F43="SL")+(G3:G43="SL"),E3:E43))

    Notice that SUM and SUMPRODUCT can also ignore text as long as you don't try to do any mathematical operations on the text values within those functions
    Last edited by daddylonglegs; 04-16-2025 at 09:01 AM.
    Audere est facere

  10. #10
    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
    91,036

    Re: How do I SUMIF if column of valunes also contains text please?

    Quote Originally Posted by habib100 View Post
    hi
    No, its 2024
    I wasn't asking you. Don't reply to questions that clearly are not for you, as it's confusing. You have added nothing helpful to this thread - don't do this again.
    Last edited by AliGW; 04-16-2025 at 07:45 AM. Reason: Typo fixed.

+ 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 matches month in one column AND text from range in another column
    By ek_shu in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-16-2024, 01:44 PM
  2. Replies: 4
    Last Post: 09-23-2016, 05:41 PM
  3. SUMIF without Formatting Column A as Text
    By EnigmaMatter in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-27-2015, 08:18 AM
  4. [SOLVED] Sumif function to total column e if text in column a appears in more than one row
    By SMITH.CRYSTAL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-23-2015, 03:58 PM
  5. [SOLVED] SUMIF all cells in one column, that are below/above a cell with a certain text?
    By tokifoki in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-08-2014, 05:28 PM
  6. SUMIF based on text in a 'date column'
    By nythng in forum Excel General
    Replies: 3
    Last Post: 04-19-2012, 06:26 PM
  7. Column Has Text and Numbers, Need To SUMIF Only Numbers
    By Karleajensar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-04-2008, 01:27 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