Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Counting instances based on two criterias

I need some help trying to count instances based on two criterias. I
have a worksheet that holds a list of records and who owns the records
and their employee number. I am trying to find a formula that will
count the humber of records a department owns and whether the record
owner is a full time employee or a contractor (based on emplyoee
number). I have tried using a Sum(If(),If()) type of function, but I
am unable to use a wildcard in the if statement, therefore it doesn't
work. The main problem I am having is determining if the record owner
is a contractor, by the cnt* in their employee number.

Any ideas????

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Marcelo
 
Posts: n/a
Default Counting instances based on two criterias

Hi Macik,

on way to solve it is using sumproduct, so the formula should be:

=sumproduct(--(range="variable_one"),--(range="variable_two"))

note that the "variables" could be a fixed cell..

hope this helps
regards from Brazil
Marcelo

" escreveu:

I need some help trying to count instances based on two criterias. I
have a worksheet that holds a list of records and who owns the records
and their employee number. I am trying to find a formula that will
count the humber of records a department owns and whether the record
owner is a full time employee or a contractor (based on emplyoee
number). I have tried using a Sum(If(),If()) type of function, but I
am unable to use a wildcard in the if statement, therefore it doesn't
work. The main problem I am having is determining if the record owner
is a contractor, by the cnt* in their employee number.

Any ideas????

Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Miguel Zapico
 
Posts: n/a
Default Counting instances based on two criterias

You can use the formula SUMPRODUCT. There you can have the two criterias
stated, and apply formulas like LEFT to the statements. For example, if the
data is in ranges A1:A50 and B1:B50
=SUMPRODUCT(--(A1:A50="Dep"),--(LEFT(B1:B50,3)="cnt"))

Hope this helps,
Miguel.

" wrote:

I need some help trying to count instances based on two criterias. I
have a worksheet that holds a list of records and who owns the records
and their employee number. I am trying to find a formula that will
count the humber of records a department owns and whether the record
owner is a full time employee or a contractor (based on emplyoee
number). I have tried using a Sum(If(),If()) type of function, but I
am unable to use a wildcard in the if statement, therefore it doesn't
work. The main problem I am having is determining if the record owner
is a contractor, by the cnt* in their employee number.

Any ideas????

Thanks in advance.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Counting instances based on two criterias

Thank You Miguel. It works perfectly. Now I am having problems with
this function:
=SUMPRODUCT(--(LEFT('Data'!B1:B500,3)="xyz"),--(IF('Data'!F2:F50027,1,0)))
It returns #VALUE, even after I do the ctrl-shft-enter to make it an
array funciton.

Any ideas?

Thanks.


Miguel Zapico wrote:
You can use the formula SUMPRODUCT. There you can have the two criterias
stated, and apply formulas like LEFT to the statements. For example, if the
data is in ranges A1:A50 and B1:B50
=SUMPRODUCT(--(A1:A50="Dep"),--(LEFT(B1:B50,3)="cnt"))

Hope this helps,
Miguel.

" wrote:

I need some help trying to count instances based on two criterias. I
have a worksheet that holds a list of records and who owns the records
and their employee number. I am trying to find a formula that will
count the humber of records a department owns and whether the record
owner is a full time employee or a contractor (based on emplyoee
number). I have tried using a Sum(If(),If()) type of function, but I
am unable to use a wildcard in the if statement, therefore it doesn't
work. The main problem I am having is determining if the record owner
is a contractor, by the cnt* in their employee number.

Any ideas????

Thanks in advance.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default Counting instances based on two criterias

" wrote:
=SUMPRODUCT(--(LEFT('Data'!B1:B500,3)="xyz"),--(IF('Data'!F2:F50027,1,0)))
It returns #VALUE ...


One guess ..

Perhaps try correcting it to ensure that the 2 ranges are identical in size:
'Data'!B1:B500 is not equal in size to 'Data'!F2:F500
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kevin Vaughn
 
Posts: n/a
Default Counting instances based on two criterias

I would say get rid of the if,then construct
=SUMPRODUCT(--(LEFT('Data'!B1:B500,3)="xyz"),--('Data'!F2:F50027))

Not tested, I just deleted what seemed to me to be extraneous. Also, you
won't need to enter this with ctrl-shift-enter

--
Kevin Vaughn


" wrote:

Thank You Miguel. It works perfectly. Now I am having problems with
this function:
=SUMPRODUCT(--(LEFT('Data'!B1:B500,3)="xyz"),--(IF('Data'!F2:F50027,1,0)))
It returns #VALUE, even after I do the ctrl-shft-enter to make it an
array funciton.

Any ideas?

Thanks.


Miguel Zapico wrote:
You can use the formula SUMPRODUCT. There you can have the two criterias
stated, and apply formulas like LEFT to the statements. For example, if the
data is in ranges A1:A50 and B1:B50
=SUMPRODUCT(--(A1:A50="Dep"),--(LEFT(B1:B50,3)="cnt"))

Hope this helps,
Miguel.

" wrote:

I need some help trying to count instances based on two criterias. I
have a worksheet that holds a list of records and who owns the records
and their employee number. I am trying to find a formula that will
count the humber of records a department owns and whether the record
owner is a full time employee or a contractor (based on emplyoee
number). I have tried using a Sum(If(),If()) type of function, but I
am unable to use a wildcard in the if statement, therefore it doesn't
work. The main problem I am having is determining if the record owner
is a contractor, by the cnt* in their employee number.

Any ideas????

Thanks in advance.




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Heather Heritage
 
Posts: n/a
Default Counting instances based on two criterias

sumproduct will do it for you

=SUMPRODUCT(--(NOT(ISERROR(SEARCH("searchtext",A1:A4)))),--(b1:b4=dept))



replace A1:A4 with the actual range of the cnt* , B1:B4 with the department
range, and dept with the department being searched for.
wrote in message
oups.com...
I need some help trying to count instances based on two criterias. I
have a worksheet that holds a list of records and who owns the records
and their employee number. I am trying to find a formula that will
count the humber of records a department owns and whether the record
owner is a full time employee or a contractor (based on emplyoee
number). I have tried using a Sum(If(),If()) type of function, but I
am unable to use a wildcard in the if statement, therefore it doesn't
work. The main problem I am having is determining if the record owner
is a contractor, by the cnt* in their employee number.

Any ideas????

Thanks in advance.



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default Counting instances based on two criterias

Instead of using Not(iserror()), you can use isnumber().

Less typing (and Tastes great, too!)

Heather Heritage wrote:

sumproduct will do it for you

=SUMPRODUCT(--(NOT(ISERROR(SEARCH("searchtext",A1:A4)))),--(b1:b4=dept))

replace A1:A4 with the actual range of the cnt* , B1:B4 with the department
range, and dept with the department being searched for.
wrote in message
oups.com...
I need some help trying to count instances based on two criterias. I
have a worksheet that holds a list of records and who owns the records
and their employee number. I am trying to find a formula that will
count the humber of records a department owns and whether the record
owner is a full time employee or a contractor (based on emplyoee
number). I have tried using a Sum(If(),If()) type of function, but I
am unable to use a wildcard in the if statement, therefore it doesn't
work. The main problem I am having is determining if the record owner
is a contractor, by the cnt* in their employee number.

Any ideas????

Thanks in advance.


--

Dave Peterson
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
Complicated counting of cells (based on other cells contents) George Excel Worksheet Functions 3 November 7th 05 06:39 PM
counting based ona number of variables. vipa2000 Excel Worksheet Functions 11 July 29th 05 04:08 PM
Counting capacity based on technician schedule Nadine Excel Worksheet Functions 1 June 5th 05 06:47 AM
Counting an Array based on a calculation HokieLawrence Excel Discussion (Misc queries) 10 February 16th 05 02:39 AM
counting instances of words in a worksheet cell CJ Excel Discussion (Misc queries) 2 December 22nd 04 02:49 AM


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