A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hi and function help please



 
 
Thread Tools Display Modes
  #1  
Old August 17th, 2006, 05:09 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Hi and function help please

My worksheet looks likes this:

A B
1 Name Fruit
2 Sam Apple
3 Sam Apple
4 Sam Apple
5 Sam Orange
6 Jane Orange
7 Jane Apple
8 Jim Orange
9 Jim Orange

I would like a function/formula that tells me how many Apples Sam has.

thank you!


  #2  
Old August 17th, 2006, 05:33 AM posted to microsoft.public.excel.worksheet.functions
Biff
external usenet poster
 
Posts: 1,559
Default Hi and function help please

Hi!

Try this:

=SUMPRODUCT(--(A2:A9="Sam"),--(B2:B9="Apple"))

Better to use cells to hold the criteria:

D1 = Sam
E1 = Apple

=SUMPRODUCT(--(A2:A9=D1),--(B2:B9=E1))

Biff

wrote in message ...
My worksheet looks likes this:

A B
1 Name Fruit
2 Sam Apple
3 Sam Apple
4 Sam Apple
5 Sam Orange
6 Jane Orange
7 Jane Apple
8 Jim Orange
9 Jim Orange

I would like a function/formula that tells me how many Apples Sam has.

thank you!




  #3  
Old August 17th, 2006, 05:45 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Hi and function help please

Thanks Biff!
Doesnt work pasting it in but I am sure it is just that I am a novice..
In your formula, =SUMPRODUCT(--(A2:A9=D1),--(B2:B9=E1))

what does the "--" between SUMPRODUCT( and (A2:... represent?

Thanks!
Andy

"Biff" wrote in message
...
Hi!

Try this:

=SUMPRODUCT(--(A2:A9="Sam"),--(B2:B9="Apple"))

Better to use cells to hold the criteria:

D1 = Sam
E1 = Apple

=SUMPRODUCT(--(A2:A9=D1),--(B2:B9=E1))

Biff

wrote in message ...
My worksheet looks likes this:

A B
1 Name Fruit
2 Sam Apple
3 Sam Apple
4 Sam Apple
5 Sam Orange
6 Jane Orange
7 Jane Apple
8 Jim Orange
9 Jim Orange

I would like a function/formula that tells me how many Apples Sam has.

thank you!






  #4  
Old August 17th, 2006, 05:48 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Hi and function help please

Actually, IT DOES work ! THANK YOU !!!!!


wrote in message ...
Thanks Biff!
Doesnt work pasting it in but I am sure it is just that I am a novice..
In your formula, =SUMPRODUCT(--(A2:A9=D1),--(B2:B9=E1))

what does the "--" between SUMPRODUCT( and (A2:... represent?

Thanks!
Andy

"Biff" wrote in message
...
Hi!

Try this:

=SUMPRODUCT(--(A2:A9="Sam"),--(B2:B9="Apple"))

Better to use cells to hold the criteria:

D1 = Sam
E1 = Apple

=SUMPRODUCT(--(A2:A9=D1),--(B2:B9=E1))

Biff

wrote in message ...
My worksheet looks likes this:

A B
1 Name Fruit
2 Sam Apple
3 Sam Apple
4 Sam Apple
5 Sam Orange
6 Jane Orange
7 Jane Apple
8 Jim Orange
9 Jim Orange

I would like a function/formula that tells me how many Apples Sam has.

thank you!








  #5  
Old August 17th, 2006, 05:57 AM posted to microsoft.public.excel.worksheet.functions
Biff
external usenet poster
 
Posts: 1,559
Default Hi and function help please

what does the "--" between SUMPRODUCT( and (A2:... represent?

Each of these expressions will return an array of TRUE's or FALSE's:

(A2:A9=D1)
(B2:B9=E1)

The "--" converts those to 1's and 0's. --TRUE = 1, --FALSE = 0

Sumproduct then sums those numbers for the result.

See this for a detailed explanation:

http://xldynamic.com/source/xld.SUMPRODUCT.html

Biff

wrote in message ...
Thanks Biff!
Doesnt work pasting it in but I am sure it is just that I am a novice..
In your formula, =SUMPRODUCT(--(A2:A9=D1),--(B2:B9=E1))

what does the "--" between SUMPRODUCT( and (A2:... represent?

Thanks!
Andy

"Biff" wrote in message
...
Hi!

Try this:

=SUMPRODUCT(--(A2:A9="Sam"),--(B2:B9="Apple"))

Better to use cells to hold the criteria:

D1 = Sam
E1 = Apple

=SUMPRODUCT(--(A2:A9=D1),--(B2:B9=E1))

Biff

wrote in message ...
My worksheet looks likes this:

A B
1 Name Fruit
2 Sam Apple
3 Sam Apple
4 Sam Apple
5 Sam Orange
6 Jane Orange
7 Jane Apple
8 Jim Orange
9 Jim Orange

I would like a function/formula that tells me how many Apples Sam has.

thank you!








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:39 PM.


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