Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default How to get Countif to work this out?

Hi all,

I have as an example:

Columns
A B
apples----------------------2
oranges--------------------3
apples----------------------4
apples----------------------5
oranges--------------------3

How can I get the totals: apples=11 and oranges=6 using Countif

Any help is greatly appreciated,
Emilio

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default How to get Countif to work this out?

On Sep 15, 6:12 pm, Wind54Surfer
wrote:
Hi all,

I have as an example:

Columns
A B
apples----------------------2
oranges--------------------3
apples----------------------4
apples----------------------5
oranges--------------------3

How can I get the totals: apples=11 and oranges=6 using Countif

Any help is greatly appreciated,
Emilio


Use sumif instead of countif:
=SUMIF(A:A;"apples";B:B)

Per Erik


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 459
Default How to get Countif to work this out?

Nel ,
Wind54Surfer ha scritto:
Hi all,

I have as an example:

Columns
A B
apples----------------------2
oranges--------------------3
apples----------------------4
apples----------------------5
oranges--------------------3

How can I get the totals: apples=11 and oranges=6 using Countif

Any help is greatly appreciated,
Emilio


Hi Emilio,

instead you should use the SUMIF function, so if yur table is A2:B5, to have
the sum of apples you can use the formula:

=SUMIF(A2:A5;"apples";B2:B5)

or, better, if you use a cell to fix the criteria, for example C2, the
formula will be:

=SUMIF(A2:A5;C2;B2:B5)

in this way if you write in C2 apples, the formula will return 11, if you
write oranges you will have 6.


--
(I'm not sure of names of menus, options and commands, because
translating from the Italian version of Excel...)

Hope I helped you.


Thanks in advance for your feedback.


Ciao


Franz Verga from Italy

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default How to get Countif to work this out?

If you have a large list, not confined to apples and oranges, try the Data
-Filter- Advanced Filter facility. ( If you are new the steps to be taken
will be as follows:

i) Ensure that the data range has got titles, say "Fruit" in one column,
"No," in the next and so on
ii) Keep the cursor on the first cell containing data
iii) Click Data -Filter - Advanced Filter - select the first column entirely
containing the names of fruits ( including the column title - "Fruit")
iv) click on "Copy to another location" button and "Unique Records only" box
v) select the first cell of a new location to copy the unique names of the
fruits ( in this case only "Apples" and "Oranges" will appear below the
column title "Fruit")
vi) Then in the cell next to the first fruit name in the filtered list use
the formula suggested by Franz Verga i.e., =SUMIF(A2:A5;C2;B2:B5) --- here
A2:A5 will represent the range of data containing the names of fruits (
without including the title cell), c2 will represent the cell containing the
fruit name i.e., adjacent to the one where you are entering the formula and
B2:B5 will represent the range of data containing the number of fruits (
excluding the cell holding the title "No.").
vii) Using F4 key, make A2:A5 and B2:B5 as absolute addresses with the $
mark. Enter and copy the formula down the filtered range to get the values
for all types of fruits.

"Franz Verga" wrote:

Nel ,
Wind54Surfer ha scritto:
Hi all,

I have as an example:

Columns
A B
apples----------------------2
oranges--------------------3
apples----------------------4
apples----------------------5
oranges--------------------3

How can I get the totals: apples=11 and oranges=6 using Countif

Any help is greatly appreciated,
Emilio


Hi Emilio,

instead you should use the SUMIF function, so if yur table is A2:B5, to have
the sum of apples you can use the formula:

=SUMIF(A2:A5;"apples";B2:B5)

or, better, if you use a cell to fix the criteria, for example C2, the
formula will be:

=SUMIF(A2:A5;C2;B2:B5)

in this way if you write in C2 apples, the formula will return 11, if you
write oranges you will have 6.


--
(I'm not sure of names of menus, options and commands, because
translating from the Italian version of Excel...)

Hope I helped you.


Thanks in advance for your feedback.


Ciao


Franz Verga from Italy


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 does not work c4ec Excel Worksheet Functions 2 February 23rd 07 03:56 PM
SUMPRODUCT vs. COUNTIF -- Why does one work? javamom Excel Worksheet Functions 3 April 25th 06 06:21 PM
Countif + vLookup: Can they work together? Spyder Excel Discussion (Misc queries) 3 February 24th 06 12:27 PM
COUNTIF doesnt work! jjj Excel Worksheet Functions 2 September 30th 05 02:38 AM
countif(a1:a12,">TODAY()") How do I get this to work? Dan Bork Excel Worksheet Functions 1 November 11th 04 10:54 PM


All times are GMT +1. The time now is 06:04 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"