+ Reply to Thread
Results 1 to 12 of 12

Using Countif formula on cells that have a Left formula

  1. #1
    Registered User
    Join Date
    10-28-2009
    Location
    San Jose, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    17

    Using Countif formula on cells that have a Left formula

    Hi,
    I'm trying to count specific value occurrences but the countif function isn't returning any values because the cells that it's counting has a Left formula.

    Is there a way to use the countif function without having to copy and paste values?

    See my attachment

    Thanks,
    Frank
    Attached Files Attached Files
    Last edited by fsoares22; 07-08-2013 at 04:26 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Using Countif formula on cells that have a Left formula

    in C4 enter =VALUE(LEFT(B4,2)) then drag it down.

  3. #3
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Re: Using Countif formula on cells that have a Left formula

    use
    Please Login or Register  to view this content.
    then drag down
    Please consider adding a * if I helped

  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: Using Countif formula on cells that have a Left formula

    Change your LEFT formula from:

    =LEFT(B4,2)

    To:

    =--LEFT(B4,2)

    Copy down, then your other COUNTIF formula will return the correct result.

    The LEFT function is a text function and returns a TEXT value even though it may look like a number. Using the double unary minus -- is one way to convert a text number into a numeric number.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    10-28-2009
    Location
    San Jose, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Using Countif formula on cells that have a Left formula

    Is it possible to enter an IF statement within the =VALUE(LEFT(INPUT!M53,2)) formula that says if there is a cell with "No Value" it puts in 0 (Zero)?

    Sometimes there are numbers and sometimes there are "No Value" text.

    Thanks,
    Franklin

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

    Re: Using Countif formula on cells that have a Left formula

    Like this...

    =IF(INPUT!M53="No Value",0,--LEFT(INPUT!M53,2))

  7. #7
    Registered User
    Join Date
    10-28-2009
    Location
    San Jose, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Using Countif formula on cells that have a Left formula

    Hi,
    I'm having a tough time incorporating 2 IF statements. Below are the two formulas I want to combine into one.

    =IF(C12="No Value","n/a",--LEFT(C12,2))

    =IF(B12="Rep 1",LEFT(C12,2),0)

    If you see my attachment for example: 2.

    Thanks,
    Franklin
    Attached Files Attached Files

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

    Re: Using Countif formula on cells that have a Left formula

    Maybe this...

    =IF(C12="No Value","n/a",IF(B12="rep 1",--LEFT(C12,2),0))

  9. #9
    Registered User
    Join Date
    10-28-2009
    Location
    San Jose, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Using Countif formula on cells that have a Left formula

    Hi,
    The formula works but it reads the first IF statement and places a value in the cell and seems to ignore the second IF statement if the first IF statement is true.

    Can you see my attached example? The highlighted cells are incorrect. I would like them to say (-1) instead of "n/a". If anything, the second IF statement should be meet first and then the second IF statement should come into play. I tried swapping the order of the formula but it creates an error message.

    Thanks for any help with this.

    Franklin
    Attached Files Attached Files

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

    Re: Using Countif formula on cells that have a Left formula

    Try this...

    Entered in D4:

    =IF($B4=D$1,IF($C4="No Value","n/a",--LEFT($C4,2)),-1)

    Copy across to F4 then down.

  11. #11
    Registered User
    Join Date
    10-28-2009
    Location
    San Jose, CA, USA
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Using Countif formula on cells that have a Left formula

    Thanks for all your help! Works great!

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

    Re: Using Countif formula on cells that have a Left formula

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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