Results 1 to 5 of 5

Thread: Formula Help

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Formula Help

    Hello,

    I need some help with creating a formula.

    Basically, I am counting up all the letters in a row (P, F, U, B, S) and then I want to minus from the calculation the count of (L) in the row however, if L = or > zero, I want the cell to be 0 .

    my current formula

    =COUNTA(J5:AN5)-COUNTIF(J5:AN5, "L")


    this is a spreadsheet tracking different types of absences but also lates. And I just want the calculation to produce the total absence types and disregard the lates entirely.

    Thank you!

  2. #2
    New Member
    Join Date
    Jul 2013
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula Help

    Are you saying that if "L" doesn't appear in any cells across that row, that the result should be 0?

    Does this do what you're looking for?

    =IF(COUNTIF(J5:AN5, "L")=0,0,COUNTA(J5:AN5)-COUNTIF(J5:AN5, "L"))

  3. #3
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,012
    Post Thanks / Like
    Mentioned
    467 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Formula Help

    Hi & welcome to MrExcel
    Not sure I understand the bit about L= or > zero, but this will count all the P,F,U,B & Ss
    =SUM(COUNTIF(J5:AN5,{"P","F","U","B","S"}))
    Last edited by Fluff; Aug 23rd, 2019 at 01:12 PM.
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  4. #4
    New Member
    Join Date
    Aug 2019
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Re: Formula Help

    Quote Originally Posted by bvbull200 View Post
    Are you saying that if "L" doesn't appear in any cells across that row, that the result should be 0?

    Does this do what you're looking for?

    =IF(COUNTIF(J5:AN5, "L")=0,0,COUNTA(J5:AN5)-COUNTIF(J5:AN5, "L"))

    That works!! Thank you!!

  5. #5
    New Member
    Join Date
    Jul 2013
    Posts
    23
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula Help

    Quote Originally Posted by cmarie1020 View Post
    That works!! Thank you!!
    My pleasure!

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •