+ Reply to Thread
Results 1 to 10 of 10

Count different words and numbers in same range to give total

  1. #1
    Registered User
    Join Date
    08-31-2013
    Location
    Rotherham, South Yorkshire
    MS-Off Ver
    Excel 2010
    Posts
    5

    Unhappy Count different words and numbers in same range to give total

    Hi.

    I think this should be a reasonably simple request but i am really struggling to get this to work. I am doing a roster for work which is really causing me an headache! Imagine that the range is B3:H3, in the cells there would be:-

    B3 - AN
    C3 - AD
    D3 - AD
    E3 - R
    F3 - R
    G3 - 1
    H3 - 1

    I then want the formula to work out in I3 the total count of the range but not to include any cell that contains R because these indicate rest days which i dont want to be part of the count.

    Any help would be really appreciated.

    Thanks.

    NIN3884.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Count different words and numbers in same range to give total

    try below in I3
    =SUMPRODUCT(--(B3:H3<>"R"))
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Count different words and numbers in same range to give total

    Another way.......

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    08-31-2013
    Location
    Rotherham, South Yorkshire
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Count different words and numbers in same range to give total

    Quote Originally Posted by hemesh View Post
    try below in I3
    =SUMPRODUCT(--(B3:H3<>"R"))
    Thanks Hamesh, brilliant! I thought it would be something reasonably simple, thanks for the prompt reply.

  5. #5
    Registered User
    Join Date
    08-31-2013
    Location
    Rotherham, South Yorkshire
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Count different words and numbers in same range to give total

    Quote Originally Posted by sktneer View Post
    Another way.......

    Please Login or Register  to view this content.

    That works too, thanks sktneer. Really appreciate the prompt response.

  6. #6
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Count different words and numbers in same range to give total

    Thanks for the feedback

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Count different words and numbers in same range to give total

    Glad to help you. Thanks for the feedback.

  8. #8
    Registered User
    Join Date
    08-31-2013
    Location
    Rotherham, South Yorkshire
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Count different words and numbers in same range to give total

    Quote Originally Posted by sktneer View Post
    Glad to help you. Thanks for the feedback.
    Hi Sktneer.

    Apologies, i have marked my question as solved which it was for my initial question (thanks again!). However when i try to calculate the total staff on duty for each day the range is B5:B61, the cell used is B62. I want to calculate only cells in B62 that count up "1", "AD","AN". I thought that a simple solution was to use the COUNTIFS function but this keeps returning a value of zero.

    Can you help?

    Thanks in advance.

  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: Count different words and numbers in same range to give total

    Maybe something like this...

    =SUM(COUNTIF(B5:B61,{1,"AD","AN"}))

    Or, using cells to hold the criteria:

    C62 = 1
    D62 = AD
    E62 = AN

    =SUMPRODUCT(COUNTIF(B5:B61,C62:E62))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Count different words and numbers in same range to give total

    If you use the same criteria range in COUNTIFS, it will return zero because it automatically include AND between them and it calculates like this.....IF B5:B61="AN" and B5:B61="AD" and B5:B61=1 which can't be true and thus return 0.

    So you can go with the formula suggested by *Tony* and moreover if your range only contains four values "AN","AD","R" and 1 as per the original post, you can also use COUNTIF with criteria "<>R".

    Hope that helps.

+ 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. HELP adding numbers in HH:MM format to give a general total?
    By BEN HM in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2014, 08:31 AM
  2. Adding multiple numbers in one cell to give a total in another
    By Lunezilla in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-11-2013, 06:12 AM
  3. [SOLVED] How to give to space between the numbers and words & changing the date format
    By Venkata Krishna in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2013, 03:14 AM
  4. How to count total words in a column?
    By Madroaster in forum Excel General
    Replies: 2
    Last Post: 04-02-2011, 01:47 PM
  5. How do I count shirt sizes and give a total of each?
    By dc112675 in forum Excel General
    Replies: 6
    Last Post: 06-23-2009, 12:41 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