Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2016, 09:03 PM
H28Sailor H28Sailor is offline having trouble with OR in COUNTIF statement Windows 7 32bit having trouble with OR in COUNTIF statement Office 2007
Advanced Beginner
having trouble with OR in COUNTIF statement
 
Join Date: Mar 2013
Posts: 55
H28Sailor is on a distinguished road
Default having trouble with OR in COUNTIF statement

I am able to use the following with a single criteria but something is wrong when I introduce the OR statement



=COUNTIF(Y$2:Y$64,OR( "7 *", "8 *", "9 *"))

What am I doing wrong?

Bob M
Reply With Quote
  #2  
Old 07-28-2016, 09:59 PM
xor xor is offline having trouble with OR in COUNTIF statement Windows 10 having trouble with OR in COUNTIF statement Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,100
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Wildcards only work for cells containing text, not for cells containing numbers.

You might want to try:

=SUMPRODUCT((--(LEFT(Y2:Y64,1))=7) + (--(LEFT(Y2:Y64,1))=8) + (--(LEFT(Y2:Y64,1))=9))
Reply With Quote
  #3  
Old 07-28-2016, 10:05 PM
H28Sailor H28Sailor is offline having trouble with OR in COUNTIF statement Windows 7 32bit having trouble with OR in COUNTIF statement Office 2007
Advanced Beginner
having trouble with OR in COUNTIF statement
 
Join Date: Mar 2013
Posts: 55
H28Sailor is on a distinguished road
Default

tried the above but get #VALUE!

Fields contain:-

7 Very Hard
8 Very Hard
9 Very Hard
Reply With Quote
  #4  
Old 07-28-2016, 10:33 PM
xor xor is offline having trouble with OR in COUNTIF statement Windows 10 having trouble with OR in COUNTIF statement Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,100
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

I misread your question - thought that your cells contained numbers. If they contain text strings (as per your examples) you can use:

=SUM(COUNTIF(Y2:Y64,{"7*","8*","9*"}))
Reply With Quote
  #5  
Old 07-28-2016, 11:01 PM
H28Sailor H28Sailor is offline having trouble with OR in COUNTIF statement Windows 7 32bit having trouble with OR in COUNTIF statement Office 2007
Advanced Beginner
having trouble with OR in COUNTIF statement
 
Join Date: Mar 2013
Posts: 55
H28Sailor is on a distinguished road
Default

Many thanks

Bob M
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with IF and COUNTIF functions jester296 Excel 1 05-13-2015 09:09 AM
Countif statements Alaska1 Excel 5 02-05-2015 07:55 PM
CountIF Functions Alaska1 Excel 4 01-30-2015 09:59 AM
having trouble with OR in COUNTIF statement COUNTIF Formula teza2k06 Excel 3 02-13-2014 12:37 PM
Countif hockeytown Excel 3 01-05-2013 08:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft