+ Reply to Thread
Results 1 to 11 of 11

Sum of text values when conditions met

Hybrid View

PawelK Sum of text values when... 01-26-2014, 05:01 PM
FDibbins Re: Sum of text values when... 01-26-2014, 05:04 PM
PawelK Re: Sum of text values when... 01-26-2014, 05:06 PM
PawelK Re: Sum of text values when... 01-26-2014, 06:19 PM
Tony Valko Re: Sum of text values when... 01-26-2014, 05:09 PM
PawelK Re: Sum of text values when... 01-26-2014, 05:23 PM
Tony Valko Re: Sum of text values when... 01-26-2014, 05:28 PM
PawelK Re: Sum of text values when... 01-26-2014, 05:32 PM
Tony Valko Re: Sum of text values when... 01-26-2014, 05:50 PM
etaf Re: Sum of text values when... 01-26-2014, 05:11 PM
FDibbins Re: Sum of text values when... 01-26-2014, 06:35 PM
  1. #1
    Registered User
    Join Date
    01-26-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Sum of text values when conditions met

    Hi.

    I am trying to sort out a little problem and not sure if it's even possible using formulas.

    I have two columns. One contains No or Yes value and the corresponding column contains L, H or M (for low,medium high).

    Above them I have three cells that will give the total for each - L,M and H.
    I want to use the formula to count all L, M and H whenever there is a Yes in a corresponding cell and return the total in all three cells above the data.

    Thank you.

    Pawel

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,053

    Re: Sum of text values when conditions met

    Hi and welcome to the forum

    Take a look at using =COUNTIFS(). Maybe something like...

    =countifs(A1:A10,"YES",B1:B10,"L")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    01-26-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Sum of text values when conditions met

    thanks but it returns error.

  4. #4
    Registered User
    Join Date
    01-26-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Sum of text values when conditions met

    Thank you FDibbins and etaf.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum of text values when conditions met

    One way...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    -----
    -----
    -----
    -----
    -----
    -----
    2
    No
    L
    L
    M
    H
    3
    No
    M
    2
    0
    2
    4
    Yes
    L
    5
    No
    M
    6
    No
    H
    7
    Yes
    H
    8
    No
    L
    9
    No
    L
    10
    Yes
    H
    11
    No
    H
    12
    No
    M
    13
    No
    L
    14
    No
    M
    15
    Yes
    L


    This formula entered in D3 and copied across:

    =COUNTIFS($A2:$A15,"Yes",$B2:$B15,D2)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    01-26-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Sum of text values when conditions met

    Thanks Tony.

    Hopefully it will work tomorrow when am in the office. Right now am using 2003 (additionally a polish version!) and realized there was no Countifs in 2003 edition. Not sure I can do it now.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum of text values when conditions met

    In Excel 2003 you would use the SUMPRODUCT function:

    =SUMPRODUCT(--($A2:$A15="Yes"),--($B2:$B15=D2))

  8. #8
    Registered User
    Join Date
    01-26-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Sum of text values when conditions met

    Brilliant! Thanks very much Tony. Me 1, my boss 0
    I need to brush up on my excel skills!

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum of text values when conditions met

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,256

    Re: Sum of text values when conditions met

    you could use a countif() or countifs() to do that

    can you load an example spreadsheet here
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,053

    Re: Sum of text values when conditions met

    You are welcome

    The main reason we ask for what version you are using is to tailor suggestions based on that version. We all suggested countifS() because your profile says 2010.

    2003 does not support that function, hence the error

+ 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. copy cell values based on conditions to a text file
    By manteca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2013, 07:45 PM
  2. copy cell values based on conditions to a text file
    By manteca in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2013, 01:55 PM
  3. [SOLVED] Text results with two conditions (lookup with two conditions)
    By Davzx in forum Excel General
    Replies: 8
    Last Post: 05-25-2012, 03:08 AM
  4. Replies: 5
    Last Post: 03-02-2011, 08:56 AM
  5. Mutliplying text and number values Macro with mutliple conditions
    By antimel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2007, 05: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