Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Multiply CountIf in one formula

Hi,

Sure this is a no brainer for any1 out there reading this but i just cant
seem to do it:

Basically what i want to do is count the number of times a certain word is
repeated in one field and then within that another word in another field...
Maybe thats not to clear so lets try an example:

This is what my excel sheet looks like:

A B C D E
1 Name Age Dept City Country
2 Wayne 24 HR JHB RSA
3 Jack 26 IT NY USA
4 Sam 28 IT JHB RSA
5 Harry 30 Sales LA USA
6 John 31 IT LA USA

So, what i want to see is how many people are in the IT Department in NY.
AS you can see from the table above there are 3 IT people but only 1 is in
NY. What should my formula look like??

This is what i have but its obviously wrong:
=COUNTIF(C2:C6,"IT")+COUNTIF(D2:D6,"NY")

Obviously its calculating both fields where its true and adding them
together which is not what i want :)

Pls help!

Cheers!

Wayne





  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Multiply CountIf in one formula

Try this:
=SUMPRODUCT(--(C2:C6="IT"),--(D2:D6="NY"))

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"ant1983" wrote in message
...
Hi,

Sure this is a no brainer for any1 out there reading this but i just cant
seem to do it:

Basically what i want to do is count the number of times a certain word is
repeated in one field and then within that another word in another
field...
Maybe thats not to clear so lets try an example:

This is what my excel sheet looks like:

A B C D E
1 Name Age Dept City Country
2 Wayne 24 HR JHB RSA
3 Jack 26 IT NY USA
4 Sam 28 IT JHB RSA
5 Harry 30 Sales LA USA
6 John 31 IT LA USA

So, what i want to see is how many people are in the IT Department in NY.
AS you can see from the table above there are 3 IT people but only 1 is in
NY. What should my formula look like??

This is what i have but its obviously wrong:
=COUNTIF(C2:C6,"IT")+COUNTIF(D2:D6,"NY")

Obviously its calculating both fields where its true and adding them
together which is not what i want :)

Pls help!

Cheers!

Wayne







  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Multiply CountIf in one formula

Damn, thanks yeah man!

"Ron Coderre" wrote:

Try this:
=SUMPRODUCT(--(C2:C6="IT"),--(D2:D6="NY"))

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"ant1983" wrote in message
...
Hi,

Sure this is a no brainer for any1 out there reading this but i just cant
seem to do it:

Basically what i want to do is count the number of times a certain word is
repeated in one field and then within that another word in another
field...
Maybe thats not to clear so lets try an example:

This is what my excel sheet looks like:

A B C D E
1 Name Age Dept City Country
2 Wayne 24 HR JHB RSA
3 Jack 26 IT NY USA
4 Sam 28 IT JHB RSA
5 Harry 30 Sales LA USA
6 John 31 IT LA USA

So, what i want to see is how many people are in the IT Department in NY.
AS you can see from the table above there are 3 IT people but only 1 is in
NY. What should my formula look like??

This is what i have but its obviously wrong:
=COUNTIF(C2:C6,"IT")+COUNTIF(D2:D6,"NY")

Obviously its calculating both fields where its true and adding them
together which is not what i want :)

Pls help!

Cheers!

Wayne








  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default Multiply CountIf in one formula

I'm glad I could help.....(thanks for the feedback)

***********
Regards,
Ron

XL2003, WinXP


"ant1983" wrote:

Damn, thanks yeah man!

"Ron Coderre" wrote:

Try this:
=SUMPRODUCT(--(C2:C6="IT"),--(D2:D6="NY"))

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"ant1983" wrote in message
...
Hi,

Sure this is a no brainer for any1 out there reading this but i just cant
seem to do it:

Basically what i want to do is count the number of times a certain word is
repeated in one field and then within that another word in another
field...
Maybe thats not to clear so lets try an example:

This is what my excel sheet looks like:

A B C D E
1 Name Age Dept City Country
2 Wayne 24 HR JHB RSA
3 Jack 26 IT NY USA
4 Sam 28 IT JHB RSA
5 Harry 30 Sales LA USA
6 John 31 IT LA USA

So, what i want to see is how many people are in the IT Department in NY.
AS you can see from the table above there are 3 IT people but only 1 is in
NY. What should my formula look like??

This is what i have but its obviously wrong:
=COUNTIF(C2:C6,"IT")+COUNTIF(D2:D6,"NY")

Obviously its calculating both fields where its true and adding them
together which is not what i want :)

Pls help!

Cheers!

Wayne








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
multiply formula where 1 cell has a (sumif) formula as a result kcip Excel Worksheet Functions 1 May 3rd 07 07:41 AM
add value of 4 cells, multiply by 3 subtract 72 multiply by 80% George A. Yorks Excel Discussion (Misc queries) 10 October 25th 06 09:45 PM
Countif, then multiply?? Gee-off Excel Worksheet Functions 4 December 7th 05 08:55 PM
How can I set up a formula to multiply $ x hrs? i.e. 8:30 (8hr 30. Tradeshow help Excel Worksheet Functions 1 March 1st 05 11:09 PM
How do I create a formula that will multiply a 5% of a value >$150 babydear12 Excel Worksheet Functions 2 October 29th 04 01:00 AM


All times are GMT +1. The time now is 11:53 AM.

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"