+ Reply to Thread
Results 1 to 11 of 11

Countifs if Left starts with "T"

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    71

    Countifs if Left starts with "T"

    I need to count the number of units with IDs that begin with a T and cannot figure out why the formula below is not working. I'm also including a workbook with my data.

    Formula = =IF(LEFT($A$13:$A$6769,1)="T*",COUNTIFS(G13:G6769,"FL",$D$13:$D$6769,"",$F$13:$F$6769,$A2),"")
    ATA.xlsb

  2. #2
    Registered User
    Join Date
    06-30-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Countifs if Left starts with "T"

    Are you trying to use an array formula?

    An alternate method is to add a column (in column I) that is =left(SRV Code, 1)
    And use this =countif(I:I,"T")

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Countifs if Left starts with "T"

    Hi,

    Your data doesn't seem to match your suggested result.

    Filtering column a for anything beginning with 'T' only results in 13 rows and any additional filters for say "FL" would only reduce this - as it happens there aren't any. So I can't see how you arrive at a count of 98 for B2.

    Please clarify.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Countifs if Left starts with "T"

    There are only 14 rows where the ID starts with 'T' and none of those rows have FL in column G so I'm not sure where you get the 98 you mention in the workbook.

    If you just wanted to count the no of rows with ID starting with 'T' you could use this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Countifs if Left starts with "T"

    Or this array formula

    =SUM(IF(LEFT($A$13:$A$6769)="T",1))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Countifs if Left starts with "T"

    There are lots of errors in F column, due to blank cells in E column. Use filter to find cells with errors and fix it.
    Quang PT

  7. #7
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Countifs if Left starts with "T"

    Please remember that the formula COUNTS occurances with multiple criteria. IDs that start with a T, matches the month from table in column A, and column G matches the header (FL).

  8. #8
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Countifs if Left starts with "T"

    As others have told, only 14 rows have ID starting with T. How is 98 the answer you wish?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  9. #9
    Registered User
    Join Date
    09-05-2012
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    71

    Re: Countifs if Left starts with "T"

    The original data contained 98, I shortened it because there are over 37k lines of data.

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Countifs if Left starts with "T"

    Quote Originally Posted by DoodlesMama View Post
    The original data contained 98, I shortened it because there are over 37k lines of data.
    Fair enough. We in fact encourage you to cut out non significant data, but don't you think it would have been a good idea to change your comment so that it reflected the data you were sharing with us.

    We might then not have wasted a lot of time puzzling over inconsistent data.

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Countifs if Left starts with "T"

    Try this one

    =SUM(IF(LEFT($A$13:$A$6769)="T",IF($G$13:$G$6769="FL",1)))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

+ 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. Adding multiple "find" with "left" /"Right"
    By Daniel1 in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-22-2014, 04:33 PM
  2. Replies: 10
    Last Post: 01-26-2012, 08:26 AM
  3. Replies: 4
    Last Post: 11-25-2011, 06:59 AM
  4. Replies: 5
    Last Post: 06-26-2006, 09:23 PM
  5. How do I get "file" tab to click on, it starts with "edit"
    By JMD_Phoenix in forum Excel General
    Replies: 1
    Last Post: 01-22-2006, 10:50 PM

Tags for this Thread

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