Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Functions/Formulas to count multiple variables

Thanks in advance for any help you may have. Not sure if I need to use IF,
COUNTIF, ARRAY...etc.

I need to count a variable for one cell based on the variable in cell two.

Example - Need to count codes for multiple locations:
Location 1 codeA codeB codec
Location 2 code3 codeX code12

Need to know all of Location 1's codeA, codeB, etc.

This is probably an easy fix, but I'm stumped.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Functions/Formulas to count multiple variables



Lets say that you have a column A with the Location names, and next columns
are filled with the codes. Some locations have more codes than the other ones
and you want to count the codes. Is that right?

If you enter the name of the location to search for in B13 to count the
codes for this location, and location names are at A1:A10 try this:

=COUNTA(INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),2,4)) :INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),10,4)))

Last number 10 means that you should enter no more than 10 codes for any
location


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Functions/Formulas to count multiple variables

Yes you have the scenario correct. I'll try your idea.
Thanks!

"Jovan Timotijevic" wrote:



Lets say that you have a column A with the Location names, and next columns
are filled with the codes. Some locations have more codes than the other ones
and you want to count the codes. Is that right?

If you enter the name of the location to search for in B13 to count the
codes for this location, and location names are at A1:A10 try this:

=COUNTA(INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),2,4)) :INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),10,4)))

Last number 10 means that you should enter no more than 10 codes for any
location


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Functions/Formulas to count multiple variables

Nope, didn't work.

Can we try another idea?

Headers: Location codeA codeB codeC

Row 1: LOC1 M 5 12
Row 2: LOC2 M 3 X
Row 3: LOC1 F 9 4
etc.

Need to count all "M"s for LOC1, then LOC2, etc.
Need to count all "F"s for LOC1, then LOC2, etc.

8 Separate locations, 10 to 15 different codes

I'm assuming there needs to be some filtering involved.

Thanks again, I appreciate any help.





"2many#s" wrote:

Yes you have the scenario correct. I'll try your idea.
Thanks!

"Jovan Timotijevic" wrote:



Lets say that you have a column A with the Location names, and next columns
are filled with the codes. Some locations have more codes than the other ones
and you want to count the codes. Is that right?

If you enter the name of the location to search for in B13 to count the
codes for this location, and location names are at A1:A10 try this:

=COUNTA(INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),2,4)) :INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),10,4)))

Last number 10 means that you should enter no more than 10 codes for any
location


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Functions/Formulas to count multiple variables

=SUMPRODUCT(--(A2:A50="LOC1"),--(B2:B50="M"))

will give the count of LOC1 and M, replace the hardcoded values with for
instance

=SUMPRODUCT(--(A2:A50=H2),--(B2:B50=I2))

where H2 is the location and I2 codeA values

change the A2:A50 and B2:B50 to real life ranges


--
Regards,

Peo Sjoblom

"2many#s" wrote in message
...
Nope, didn't work.

Can we try another idea?

Headers: Location codeA codeB codeC

Row 1: LOC1 M 5 12
Row 2: LOC2 M 3 X
Row 3: LOC1 F 9 4
etc.

Need to count all "M"s for LOC1, then LOC2, etc.
Need to count all "F"s for LOC1, then LOC2, etc.

8 Separate locations, 10 to 15 different codes

I'm assuming there needs to be some filtering involved.

Thanks again, I appreciate any help.





"2many#s" wrote:

Yes you have the scenario correct. I'll try your idea.
Thanks!

"Jovan Timotijevic" wrote:



Lets say that you have a column A with the Location names, and next
columns
are filled with the codes. Some locations have more codes than the
other ones
and you want to count the codes. Is that right?

If you enter the name of the location to search for in B13 to count the
codes for this location, and location names are at A1:A10 try this:

=COUNTA(INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),2,4)) :INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),10,4)))

Last number 10 means that you should enter no more than 10 codes for
any
location






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Functions/Formulas to count multiple variables

Dear Peo,

You are my HERO!!!! Thank you - its working!!!! You have solved a huge
problem for me.

Thanks to everyone who came up with ideas.

KP

"Peo Sjoblom" wrote:

=SUMPRODUCT(--(A2:A50="LOC1"),--(B2:B50="M"))

will give the count of LOC1 and M, replace the hardcoded values with for
instance

=SUMPRODUCT(--(A2:A50=H2),--(B2:B50=I2))

where H2 is the location and I2 codeA values

change the A2:A50 and B2:B50 to real life ranges


--
Regards,

Peo Sjoblom

"2many#s" wrote in message
...
Nope, didn't work.

Can we try another idea?

Headers: Location codeA codeB codeC

Row 1: LOC1 M 5 12
Row 2: LOC2 M 3 X
Row 3: LOC1 F 9 4
etc.

Need to count all "M"s for LOC1, then LOC2, etc.
Need to count all "F"s for LOC1, then LOC2, etc.

8 Separate locations, 10 to 15 different codes

I'm assuming there needs to be some filtering involved.

Thanks again, I appreciate any help.





"2many#s" wrote:

Yes you have the scenario correct. I'll try your idea.
Thanks!

"Jovan Timotijevic" wrote:



Lets say that you have a column A with the Location names, and next
columns
are filled with the codes. Some locations have more codes than the
other ones
and you want to count the codes. Is that right?

If you enter the name of the location to search for in B13 to count the
codes for this location, and location names are at A1:A10 try this:

=COUNTA(INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),2,4)) :INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),10,4)))

Last number 10 means that you should enter no more than 10 codes for
any
location





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Functions/Formulas to count multiple variables

Thanks for the feedback


--
Regards,

Peo Sjoblom



"2many#s" wrote in message
...
Dear Peo,

You are my HERO!!!! Thank you - its working!!!! You have solved a huge
problem for me.

Thanks to everyone who came up with ideas.

KP

"Peo Sjoblom" wrote:

=SUMPRODUCT(--(A2:A50="LOC1"),--(B2:B50="M"))

will give the count of LOC1 and M, replace the hardcoded values with for
instance

=SUMPRODUCT(--(A2:A50=H2),--(B2:B50=I2))

where H2 is the location and I2 codeA values

change the A2:A50 and B2:B50 to real life ranges


--
Regards,

Peo Sjoblom

"2many#s" wrote in message
...
Nope, didn't work.

Can we try another idea?

Headers: Location codeA codeB codeC

Row 1: LOC1 M 5 12
Row 2: LOC2 M 3 X
Row 3: LOC1 F 9 4
etc.

Need to count all "M"s for LOC1, then LOC2, etc.
Need to count all "F"s for LOC1, then LOC2, etc.

8 Separate locations, 10 to 15 different codes

I'm assuming there needs to be some filtering involved.

Thanks again, I appreciate any help.





"2many#s" wrote:

Yes you have the scenario correct. I'll try your idea.
Thanks!

"Jovan Timotijevic" wrote:



Lets say that you have a column A with the Location names, and next
columns
are filled with the codes. Some locations have more codes than the
other ones
and you want to count the codes. Is that right?

If you enter the name of the location to search for in B13 to count
the
codes for this location, and location names are at A1:A10 try this:

=COUNTA(INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),2,4)) :INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),10,4)))

Last number 10 means that you should enter no more than 10 codes for
any
location







  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Functions/Formulas to count multiple variables

Dear Peo,

One more question: I tried to enter a range of J3:Q50 as the 2nd ARRAY, and
got the VALUE! error code. I need to be able to select from a range like
this.
Any suggestions?


=SUMPRODUCT(--(A2:A50="LOC1"),--(J3:Q50="M"))

Thanks again,
Kelly

"Peo Sjoblom" wrote:

Thanks for the feedback


--
Regards,

Peo Sjoblom



"2many#s" wrote in message
...
Dear Peo,

You are my HERO!!!! Thank you - its working!!!! You have solved a huge
problem for me.

Thanks to everyone who came up with ideas.

KP

"Peo Sjoblom" wrote:

=SUMPRODUCT(--(A2:A50="LOC1"),--(B2:B50="M"))

will give the count of LOC1 and M, replace the hardcoded values with for
instance

=SUMPRODUCT(--(A2:A50=H2),--(B2:B50=I2))

where H2 is the location and I2 codeA values

change the A2:A50 and B2:B50 to real life ranges


--
Regards,

Peo Sjoblom

"2many#s" wrote in message
...
Nope, didn't work.

Can we try another idea?

Headers: Location codeA codeB codeC

Row 1: LOC1 M 5 12
Row 2: LOC2 M 3 X
Row 3: LOC1 F 9 4
etc.

Need to count all "M"s for LOC1, then LOC2, etc.
Need to count all "F"s for LOC1, then LOC2, etc.

8 Separate locations, 10 to 15 different codes

I'm assuming there needs to be some filtering involved.

Thanks again, I appreciate any help.





"2many#s" wrote:

Yes you have the scenario correct. I'll try your idea.
Thanks!

"Jovan Timotijevic" wrote:



Lets say that you have a column A with the Location names, and next
columns
are filled with the codes. Some locations have more codes than the
other ones
and you want to count the codes. Is that right?

If you enter the name of the location to search for in B13 to count
the
codes for this location, and location names are at A1:A10 try this:

=COUNTA(INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),2,4)) :INDIRECT(ADDRESS(MATCH(B13,A1:A10,0),10,4)))

Last number 10 means that you should enter no more than 10 codes for
any
location








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
multiple variables in sumproduct or if/then formulas Ang Excel Worksheet Functions 4 April 11th 07 05:28 PM
constructing (complex) variables with worksheet functions broer konijn Excel Discussion (Misc queries) 0 May 16th 06 10:55 PM
LOGICAL FUNCTIONS WITH MULTIPLE VARIABLES luiss Excel Worksheet Functions 3 November 18th 05 04:08 PM
Can I use variables for workheet name references in Excel functions? Amihai Bareket Excel Discussion (Misc queries) 1 February 4th 05 05:11 PM
Can I use variables for workheet name references in Excel functions? Amihai Bareket Excel Worksheet Functions 1 February 4th 05 05:11 PM


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