# Using Countif formula on cells that have a Left formula

1. ## 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  Register To Reply

2. ## Re: Using Countif formula on cells that have a Left formula

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

3. ## Re: Using Countif formula on cells that have a Left formula

use ``Please Login or Register  to view this content.``
then drag down  Register To Reply

4. ## Re: Using Countif formula on cells that have a Left formula

=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.  Register To Reply

5. ## 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  Register To Reply

6. ## Re: Using Countif formula on cells that have a Left formula

Like this...

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

7. ## 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  Register To Reply

8. ## 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))  Register To Reply

9. ## 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  Register To Reply

10. ## 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.  Register To Reply

11. ## Re: Using Countif formula on cells that have a Left formula

Thanks for all your help! Works great!  Register To Reply

12. ## Re: Using Countif formula on cells that have a Left formula

You're welcome. Thanks for the feedback!   Register To Reply