Nesting the Count if formula

Deuce Bucksman

Board Regular
Joined
Jan 17, 2011
Messages
102
Hello, Gurus.

I'm trying to count only cells that are equal to 1 in a string of 8 cells (fifth cell to the right). For some reason, the count if formula is not allowing me to nest the left and right functions together. Can anyone tell me what is wrong with the formula below. I really appreciate your help! Thanks!


countif(C19:C338,LEFT(RIGHT(C19,4),1) "=1")
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Don't know what you're trying to do with"=1" at the end, but it looks like that is the cause of the problem.

Try removing that, if it doesn't give the result you want then try posting some examples.
 
Upvote 0
The left(right) nesting formula returns the value of 1. I put the "= 1" so it would only count the cells where the nested formula is equal to 1. Otherwise it will just return the value of zero since i'm not telling it to equal anything. I am perplexed.
 
Upvote 0
You can't use additional functions inside of a COUNTIF, as it is not evaluated as an array formula. For your requirements, try a SUMPRODUCT:

=SUMPRODUCT(--(LEFT(RIGHT(C19:C338,4),1)="1"))
 
Upvote 0
can you give examples of the values you want to count - are these numbers or alphanumeric or something else?
 
Upvote 0
I guessed that barry, but didn't see your question til after I hit the submit button.

Failure to refresh?? :hammer: Gulity as charged lol
 
Upvote 0
Thanks, all! Both the sumproduct formula and the countif formula worked perfectly. To answer Houdini's question: The cells to be evaluated are text ( I think) since it is both numeric and text (84xx1x1B). Sorry it took so long to come back with a response. I appreciate all your help!
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,282
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top