#1   Report Post  
Posted to microsoft.public.excel.misc
Voodoodan
 
Posts: n/a
Default Counting


Hi all,

Can anyone tell me if there's a quick formula that can be done with the
following, please, to show only the amount of times 'apples' appears in
a row at the bottom of the list? For example:

apples
grapes
bananas
apples
pears
apples
apples
apples

The formula should show '3'.

This list would be updated with further fruity developments, so the
formula should be able to adapt to show only the times 'apples' appears
at the bottom of the list in a row.

Would be most appreciated if anyone knows the answer.

Many thanks,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile: http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630

  #2   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Counting

Hi

Have a look at COUNTIF()
=COUNTIF(A2:A28,"apples")

Andy.

"Voodoodan" wrote
in message ...

Hi all,

Can anyone tell me if there's a quick formula that can be done with the
following, please, to show only the amount of times 'apples' appears in
a row at the bottom of the list? For example:

apples
grapes
bananas
apples
pears
apples
apples
apples

The formula should show '3'.

This list would be updated with further fruity developments, so the
formula should be able to adapt to show only the times 'apples' appears
at the bottom of the list in a row.

Would be most appreciated if anyone knows the answer.

Many thanks,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile:
http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630



  #3   Report Post  
Posted to microsoft.public.excel.misc
John Lyons
 
Posts: n/a
Default Counting

=COUNTIF(A1:A3,A1)

where A1:A3 is the range, and A1 is what you are counting

"Voodoodan" wrote:


Hi all,

Can anyone tell me if there's a quick formula that can be done with the
following, please, to show only the amount of times 'apples' appears in
a row at the bottom of the list? For example:

apples
grapes
bananas
apples
pears
apples
apples
apples

The formula should show '3'.

This list would be updated with further fruity developments, so the
formula should be able to adapt to show only the times 'apples' appears
at the bottom of the list in a row.

Would be most appreciated if anyone knows the answer.

Many thanks,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile: http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630


  #4   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default Counting

=SUMPRODUCT((A1:A8="apples")*(A1:A8=A2:A9))

HTH
--
AP

"Voodoodan" a écrit
dans le message de
...

Hi all,

Can anyone tell me if there's a quick formula that can be done with the
following, please, to show only the amount of times 'apples' appears in
a row at the bottom of the list? For example:

apples
grapes
bananas
apples
pears
apples
apples
apples

The formula should show '3'.

This list would be updated with further fruity developments, so the
formula should be able to adapt to show only the times 'apples' appears
at the bottom of the list in a row.

Would be most appreciated if anyone knows the answer.

Many thanks,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile:

http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630



  #5   Report Post  
Posted to microsoft.public.excel.misc
Ardus Petus
 
Posts: n/a
Default Counting

My formula produces a wrong result (3) on following list:

apples
grapes
grapes
apples
apples
oranges
apples
apples


Sorry!
--
AP

"Ardus Petus" a écrit dans le message de
...
=SUMPRODUCT((A1:A8="apples")*(A1:A8=A2:A9))

HTH
--
AP

"Voodoodan" a

écrit
dans le message de
...

Hi all,

Can anyone tell me if there's a quick formula that can be done with the
following, please, to show only the amount of times 'apples' appears in
a row at the bottom of the list? For example:

apples
grapes
bananas
apples
pears
apples
apples
apples

The formula should show '3'.

This list would be updated with further fruity developments, so the
formula should be able to adapt to show only the times 'apples' appears
at the bottom of the list in a row.

Would be most appreciated if anyone knows the answer.

Many thanks,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile:

http://www.excelforum.com/member.php...nfo&userid=597
View this thread:

http://www.excelforum.com/showthread...hreadid=525630







  #6   Report Post  
Posted to microsoft.public.excel.misc
Voodoodan
 
Posts: n/a
Default Counting


Hi,

The first two examples seem to produce all the results of "apples" in
the list. I just need the formula look at the column and calculate how
many "apples" there are from the bottom of the list, until there's a
change in the list, ie., with the below it will count only 3 apples
from the bottom because 'pears' is next in line.

apples
grapes
bananas
apples
pears
apples
apples
apples

If I decide to stick the following onto the end of this list:

bananas
apples
grapes
apples
apples

the formula would then need to be able to recalculate and show "2",
because there are only now 2 examples of apples from the bottom of the
list.

Hope this throws a bit more light on what I'm after!

Thanks v much,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile: http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630

  #7   Report Post  
Posted to microsoft.public.excel.misc
Domenic
 
Posts: n/a
Default Counting

Try...

=COUNTIF(INDEX(A2:A9,MATCH(2,1/(A2:A9<"Apples"))):A9,"Apples")

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

In article ,
Voodoodan
wrote:

Hi,

The first two examples seem to produce all the results of "apples" in
the list. I just need the formula look at the column and calculate how
many "apples" there are from the bottom of the list, until there's a
change in the list, ie., with the below it will count only 3 apples
from the bottom because 'pears' is next in line.

apples
grapes
bananas
apples
pears
apples
apples
apples

If I decide to stick the following onto the end of this list:

bananas
apples
grapes
apples
apples

the formula would then need to be able to recalculate and show "2",
because there are only now 2 examples of apples from the bottom of the
list.

Hope this throws a bit more light on what I'm after!

Thanks v much,
Dan.

  #8   Report Post  
Posted to microsoft.public.excel.misc
Voodoodan
 
Posts: n/a
Default Counting


Hi,

That's good thanks, but it works only if you manually alter the formula
to show where the last cell is, ie., A9.

I was hoping that the formula would recalculate automatically, so that
it somehow knows where the last entry is in the column, and works it
out from there.

Sorry for being a picky so and so!!

Thanks,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile: http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630

  #9   Report Post  
Posted to microsoft.public.excel.misc
Voodoodan
 
Posts: n/a
Default Counting


Hi,

That's good thanks, but it works only if you manually alter the formula
to show where the last cell is, ie., A9.

I was hoping that the formula would recalculate automatically, so that
it somehow knows where the last entry is in the column, and works it
out from there.

Sorry for being a picky so and so!!

Thanks,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile: http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630

  #10   Report Post  
Posted to microsoft.public.excel.misc
Domenic
 
Posts: n/a
Default Counting

Try the following instead...

B2:

=MATCH(REPT("z",255),A:A)

C2:

=COUNTIF(INDEX(A2:INDEX(A:A,B2),MATCH(2,1/((A2:INDEX(A:A,B2)<"")*(A2:IND
EX(A:A,B2)<"Apples")))):INDEX(A:A,B2),"Apples")

....confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!

In article ,
Voodoodan
wrote:

Hi,

That's good thanks, but it works only if you manually alter the formula
to show where the last cell is, ie., A9.

I was hoping that the formula would recalculate automatically, so that
it somehow knows where the last entry is in the column, and works it
out from there.

Sorry for being a picky so and so!!

Thanks,
Dan.



  #11   Report Post  
Posted to microsoft.public.excel.misc
Voodoodan
 
Posts: n/a
Default Counting


That is spot on! Thank you very much for your efforts.

I'd love to know what the 'rept' function does here, but otherwise
that's worked beautifully.

Thank you,
Dan.


--
Voodoodan
------------------------------------------------------------------------
Voodoodan's Profile: http://www.excelforum.com/member.php...nfo&userid=597
View this thread: http://www.excelforum.com/showthread...hreadid=525630

  #12   Report Post  
Posted to microsoft.public.excel.misc
Domenic
 
Posts: n/a
Default Counting

REPT ("z",255 ) is a large text value starting with the 26 English
letters. It's the largest text value recognized by MATCH and other
lookup functions. Since the 'match type' is omitted, it defaults to 1
and, therefore, doesn't look for an exact match. Used this way, it
returns the position of the last text value within a range.

Hope this helps!

In article ,
Voodoodan
wrote:

That is spot on! Thank you very much for your efforts.

I'd love to know what the 'rept' function does here, but otherwise
that's worked beautifully.

Thank you,
Dan.

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
conditional counting with Excel LeicaElmar Excel Worksheet Functions 1 October 17th 05 10:23 PM
counting rows with same values for multiple values Jon Viehe New Users to Excel 4 September 1st 05 03:49 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM
Counting... Patrick G Excel Worksheet Functions 3 February 23rd 05 10:05 PM


All times are GMT +1. The time now is 05:35 PM.

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

About Us

"It's about Microsoft Excel"