Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Syntax for Countif condition where only 1st char in Range of each cell = "M"
2003-2007
Facts: Range("A1").Value = "M7" Range("B1").Value = "M9" Challenge: What would the syntax be to Countif(A1:B1,????) where ???? is the value of Left(A1,1) = "M"? In short, I want to count all "M" regardless of the Number. Thus Countif(A1:B1,????) = 2 Is this possible? TIA EagleOne |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Syntax for Countif condition where only 1st char in Range of each cell = "M"
Ignore my reference to VBA as I need a w/s formula
wrote: 2003-2007 Facts: Range("A1").Value = "M7" Range("B1").Value = "M9" Challenge: What would the syntax be to Countif(A1:B1,????) where ???? is the value of Left(A1,1) = "M"? In short, I want to count all "M" regardless of the Number. Thus Countif(A1:B1,????) = 2 Is this possible? TIA EagleOne |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Syntax for Countif condition where only 1st char in Range of each cell = "M"
Hi
If the cells always have only 2 characteres use: =COUNTIF(A1:A5;"M?") If the cells can have more characters, use: =COUNTIF(A1:A5;"M*") Regards, Per skrev i meddelelsen ... Ignore my reference to VBA as I need a w/s formula wrote: 2003-2007 Facts: Range("A1").Value = "M7" Range("B1").Value = "M9" Challenge: What would the syntax be to Countif(A1:B1,????) where ???? is the value of Left(A1,1) = "M"? In short, I want to count all "M" regardless of the Number. Thus Countif(A1:B1,????) = 2 Is this possible? TIA EagleOne |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Syntax for Countif condition where only 1st char in Range of each cell = "M"
Try this formula...
=COUNTIF(A1:A100,"M*") -- Rick (MVP - Excel) wrote in message ... Ignore my reference to VBA as I need a w/s formula wrote: 2003-2007 Facts: Range("A1").Value = "M7" Range("B1").Value = "M9" Challenge: What would the syntax be to Countif(A1:B1,????) where ???? is the value of Left(A1,1) = "M"? In short, I want to count all "M" regardless of the Number. Thus Countif(A1:B1,????) = 2 Is this possible? TIA EagleOne |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Syntax for Countif condition where only 1st char in Range of each cell = "M"
Thanks Rick.
I was sure over thinking it! "Rick Rothstein" wrote: Try this formula... =COUNTIF(A1:A100,"M*") |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Syntax for Countif condition where only 1st char in Range of each cell = "M"
Thanks Per.
I was sure over thinking it! "Per Jessen" wrote: Hi If the cells always have only 2 characteres use: =COUNTIF(A1:A5;"M?") If the cells can have more characters, use: =COUNTIF(A1:A5;"M*") Regards, Per skrev i meddelelsen .. . Ignore my reference to VBA as I need a w/s formula wrote: 2003-2007 Facts: Range("A1").Value = "M7" Range("B1").Value = "M9" Challenge: What would the syntax be to Countif(A1:B1,????) where ???? is the value of Left(A1,1) = "M"? In short, I want to count all "M" regardless of the Number. Thus Countif(A1:B1,????) = 2 Is this possible? TIA EagleOne |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to write formula for countif (range,"<2" &"3") | Excel Discussion (Misc queries) | |||
correct syntax for nesting "if", "and", and "vlookup"....if possib | Excel Worksheet Functions | |||
row by row comparison using a "countif" and "and" condition? | Excel Programming | |||
What is the syntax for using the "IF" condition with an autofilte. | Excel Discussion (Misc queries) | |||
what is syntax for if(between range of dates,"Q1","Q2")? | Excel Worksheet Functions |