Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default COUNTIF(RANGE,"?") and search for contains

How do I perform a countif with the criteria being I want to count the number
of question marks?

Also, can I do countifs in a if it contains something versus equals something?

Say a cell contains "Guadalajara, Mexico"

can I get somrhting like =countif(cell,contains"Mexico") to return a 1?

Thank you!

(Excel 2003 on XP Pro. Also curious how to do it in Excel 2007 on XP Pro)

Thanks

--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default COUNTIF(RANGE,"?") and search for contains

try this

=COUNTIF(A1:A30,"*Mexico*")

and

=COUNTIF(A1:A30,"?")

Mike



"BlueWolverine" wrote:

How do I perform a countif with the criteria being I want to count the number
of question marks?

Also, can I do countifs in a if it contains something versus equals something?

Say a cell contains "Guadalajara, Mexico"

can I get somrhting like =countif(cell,contains"Mexico") to return a 1?

Thank you!

(Excel 2003 on XP Pro. Also curious how to do it in Excel 2007 on XP Pro)

Thanks

--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default COUNTIF(RANGE,"?") and search for contains

One way:

To count single question marks

=COUNTIF(A:A,"~?")

To count the number of cells in a range that contain a question mark
anywhere within their content:

=COUNTIF(A:A,"*~?*")

Similarly,

=COUNTIF(A1,"*Mexico*")

In article ,
BlueWolverine wrote:

How do I perform a countif with the criteria being I want to count the number
of question marks?

Also, can I do countifs in a if it contains something versus equals something?

Say a cell contains "Guadalajara, Mexico"

can I get somrhting like =countif(cell,contains"Mexico") to return a 1?

Thank you!

(Excel 2003 on XP Pro. Also curious how to do it in Excel 2007 on XP Pro)

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default COUNTIF(RANGE,"?") and search for contains

Your last example will count any cell that contains a single character -
the question mark acts as a wild card.

To look for the question mark itself, you need to escape it with the
tilde character:

=COUNTIF(A1:A30,"~?")


In article ,
Mike H wrote:

try this

=COUNTIF(A1:A30,"*Mexico*")

and

=COUNTIF(A1:A30,"?")

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default COUNTIF(RANGE,"?") and search for contains

Of course it does, thanks for the correction

Mike

"JE McGimpsey" wrote:

Your last example will count any cell that contains a single character -
the question mark acts as a wild card.

To look for the question mark itself, you need to escape it with the
tilde character:

=COUNTIF(A1:A30,"~?")


In article ,
Mike H wrote:

try this

=COUNTIF(A1:A30,"*Mexico*")

and

=COUNTIF(A1:A30,"?")




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default COUNTIF(RANGE,"?") and search for contains

Thank you. That locks it up.
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


"JE McGimpsey" wrote:

One way:

To count single question marks

=COUNTIF(A:A,"~?")

To count the number of cells in a range that contain a question mark
anywhere within their content:

=COUNTIF(A:A,"*~?*")

Similarly,

=COUNTIF(A1,"*Mexico*")

In article ,
BlueWolverine wrote:

How do I perform a countif with the criteria being I want to count the number
of question marks?

Also, can I do countifs in a if it contains something versus equals something?

Say a cell contains "Guadalajara, Mexico"

can I get somrhting like =countif(cell,contains"Mexico") to return a 1?

Thank you!

(Excel 2003 on XP Pro. Also curious how to do it in Excel 2007 on XP Pro)

Thanks


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 36
Default COUNTIF(RANGE,"?") and search for contains

Let me clarify, that fixes my problems. I just reread my post that makes it
sound like I am being a smart @$$ and telling you your fix locks my computer
up. ALL GOOD!
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


"BlueWolverine" wrote:

Thank you. That locks it up.
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


"JE McGimpsey" wrote:

One way:

To count single question marks

=COUNTIF(A:A,"~?")

To count the number of cells in a range that contain a question mark
anywhere within their content:

=COUNTIF(A:A,"*~?*")

Similarly,

=COUNTIF(A1,"*Mexico*")

In article ,
BlueWolverine wrote:

How do I perform a countif with the criteria being I want to count the number
of question marks?

Also, can I do countifs in a if it contains something versus equals something?

Say a cell contains "Guadalajara, Mexico"

can I get somrhting like =countif(cell,contains"Mexico") to return a 1?

Thank you!

(Excel 2003 on XP Pro. Also curious how to do it in Excel 2007 on XP Pro)

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COUNTIF "EVEN" numbers in a range Udi14 Excel Discussion (Misc queries) 6 May 2nd 23 11:43 AM
=IF(ISERROR(SEARCH("insurance",A125,1)),"","*") cynichromantique Excel Worksheet Functions 9 September 25th 08 09:49 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Array as a "named range" - formula ok in cells, but error as "named range" tskogstrom Excel Discussion (Misc queries) 11 December 28th 06 04:44 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"