+ Reply to Thread
Results 1 to 4 of 4

problem counting number with letter in formula

  1. #1
    Registered User
    Join Date
    11-08-2013
    Location
    Tennessee, United States
    MS-Off Ver
    Excel Mac 2003
    Posts
    2

    problem counting number with letter in formula

    I am making a formula where criteria varies as to what the end number is. I'm using the formula below and it works well when I use: number, *, or all letters like "ADM." It does not work when the criteria is: 7C, 19C, or 7a, 7s. You get what I mean. I need to have the criteria of: 7C=12.5. I'm adding up number of hours worked on a shift. Anyone with suggestions?




    =COUNTIF(P6:P41,"7")*1+COUNTIF(P6:P41,"7*")*1+COUNTIF(P6:P41,"8")*1+COUNTIF(P6:P41,"8*")*1+ COUNTIF(P6:P41,"9")*1+COUNTIF(P6:P41,"9*")*1+COUNTIF(P6:P41,"11")*1+COUNTIF(P6:P41,"11*")*1

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

    Re: problem counting number with letter in formula

    Anyone with suggestions?
    Yes.

    Do not mix numbers and text in the same cell. Put the numbers in one cell and the letters (text) in another cell.

    If you can't do that (read: refuse to do that ) then it would help us if you could post a SMALL sample file with the desired results so we can see what needs to be done.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    11-08-2013
    Location
    Tennessee, United States
    MS-Off Ver
    Excel Mac 2003
    Posts
    2

    Re: problem counting number with letter in formula

    Tony, Thank-you for the reply. I inherited a schedule when I became manager and want to see if I can work with it before I make changes (I'v already made a lot of changes). The previous manager did all the scheduling of staff on paper but it needs to be done on a shared drive so all the managers have access to it. They are using numbers and letters entered in cells to represent certain shifts: for 7 cells in a row (1 week work) we may enter: 7 (12.25hrs), 7*(12.25hrs), 7C (12.25hrs), 7a (10hrs), 7s (8hrs), LV8 (8hr), LV12 (12hrs). There are other combinations but this is the idea.

    At the end of the 7 cells (1 week) is a cell with the formula below. This represents the total number of hrs worked for the week. The cells with the number/letter combination don't add correctly consistently.

    =COUNTIF(AG5:AT5,"7")*12.25+COUNTIF(AG5:AT5,"7*")*12.25+
    COUNTIF(AG5:AT5,"ADMS")*8+COUNTIF(AG5:AT5,"ADM")*10+
    COUNTIF(AG5:AT5,"9")*12+COUNTIF(AG5:AT5,"9*")*12+
    COUNTIF(AG5:AT5,"11")*12+COUNTIF(AG5:AT5,"11*")*12+
    COUNTIF(AG5:AT5,"19")*12.25+COUNTIF(AG5:AT5,"19*")*12.25+
    COUNTIF(AG5:AT5,"23")*8+COUNTIF(AG5:AT5,"LV8")*8+
    COUNTIF(AG5:AT5,"LVL")*12+COUNTIF(AG5:AT5,"BLS")*8+
    COUNTIF(AG5:AT5,"ACLS")*8+COUNTIF(AG5:AT5,"PALS")*8+
    COUNTIF(AG5:AT5,"SED")*4+COUNTIF(AG5:AT5,"H")*8+
    COUNTIF(AG5:AT5,"R")*0+COUNTIF(AG5:AT5,"D")*0+
    COUNTIF(AG5:AT5,"PASS")*8+COUNTIF(AG5:AT5,"TDY")*8

    Thank-you for looking at this.

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

    Re: problem counting number with letter in formula

    I understand your reluctance to change but from the looks of things, and don't take this personally, this looks like a nightmare to deal with.

    I would need to see the file with all the possible codes (and their definitions) to try to figure out a better way to do this. I don't need to see all the data, just the portion where you enter these times/codes. Just a few rows worth of data will be plenty.

    You want to avoid having to use "monster formulas", especially if they don't work. A formula either works or it doesn't. There is no "gray area"!

+ 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. [SOLVED] Rolling year and letter counting formula help please
    By Sho431 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2013, 05:46 PM
  2. Replies: 17
    Last Post: 07-16-2009, 03:12 AM
  3. Req. Formula for converting a letter to a number
    By dustyv in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-21-2007, 02:47 AM
  4. Help to write a formula using a letter value and a number value
    By Ikeagle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2006, 08:44 PM
  5. Format:change headers from letter to number/number to letter
    By Biff in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM

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