Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2013, 12:00 PM
hockeytown hockeytown is offline Countif Windows 2K Countif Office 2010 64bit
Novice
Countif
 
Join Date: Aug 2012
Posts: 12
hockeytown is on a distinguished road
Default Countif

Hello,



I am working in a spreadsheet where I want to count how many cells start with "2011". My numbering is 8 digits (e.g., 20111234 where I want to capture those starting with 2011).

I have tried the following:
=COUNTIF(B2:B2154,"2011*"
but it returns a "0" as the result.

Any thoughts?
Reply With Quote
  #2  
Old 01-04-2013, 12:54 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Countif Windows 7 64bit Countif Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Perhaps
Code:
=SUMPRODUCT(--(left(B2:B2154,4)="2011"))
Your formula looks for a string where XL sees a number
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 01-04-2013, 01:03 PM
hockeytown hockeytown is offline Countif Windows 2K Countif Office 2010 64bit
Novice
Countif
 
Join Date: Aug 2012
Posts: 12
hockeytown is on a distinguished road
Default

That worked!

Thanks so much!
Reply With Quote
  #4  
Old 01-05-2013, 08:06 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Countif Windows 7 32bit Countif Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

To do it with countif:
Code:
=COUNTIF(A:A,">=20110000")-COUNTIF(A:A,">=20120000")
 
or
 
=SUM(COUNTIF(A:A,">=201"&{1,2}&"0000")*{1,-1})
__________________
Colin

RAD Excel Blog
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif Countif issue Katy I Excel 2 07-11-2012 06:30 AM
COUNTIF and Cell address problem ColinC Excel 3 12-24-2011 04:08 AM
Countif Vlookup, offset, match & countif jujuwillis Excel 2 10-15-2011 11:06 AM
Countif using a cell content as a string with COUNTIF geoffm Excel 1 08-16-2011 11:31 AM
Countif Countif with 2 criteria ibrahimaa Excel 3 05-23-2011 11:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:07 AM.


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