Count number of value repeated.

lazylilsnoop

New Member
Joined
Feb 29, 2012
Messages
34
Hi,

Type
Cost
Z
100
Z
100
Z,Y
200
Z,P
100
Z,Y,P
100

<tbody>
</tbody>

this is simplified version of what I'm trying to search, my list goes until 2000 cells

anyway, i need to figure out how many "Z" appears in TYPE
I used "countif(A2:A5, "Z") but it return the value 3.
if i want it to return 5, what should i input?

The other question is if i would like to sum of all the value that has Type Z in it, what is the formula?
"=sumif(A2:A5,"Z",B2:B5)" couldn't do the trick


thanks alot
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

vogel997

Active Member
Joined
Jan 22, 2010
Messages
412
Try this

=countif(A1:A5, "Z*")

=SUMIF(A1:A5,"z*",B1:B5)
 
Last edited:

lazylilsnoop

New Member
Joined
Feb 29, 2012
Messages
34
Awesome! by adding the " * " at the back of the word really does the magic.

but what if I were to type Z in a cell,A20 (just so that i can search the whole sheet by changing the Type I need to search)?
e.g "=countif(A1:A5,A20)"
 

lazylilsnoop

New Member
Joined
Feb 29, 2012
Messages
34
This formula totally works!!!

I added "*"& infront and back....
so everything works perfectly now!! thanks
 

Forum statistics

Threads
1,137,063
Messages
5,679,399
Members
419,825
Latest member
MegastarMagus

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
Top