Welcome to the Excel Forum

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.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-18-2009, 10:15 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
CountIF multiple parameters

Please Register to Remove these Ads

Well not multiple really, only two mind you.

I have a long list of past jobs, around 4000+. I have multiple fields, but I really wish to concentrate on the:

1) Job Type - Example would be Medical or Imprint

2) Job # - Correlates when it was done - Example would be 91059 would be a job within 2008-2009 fiscal year.

All the jobs are listed in the first spreadsheet. The second spreadsheet will hold generalized data broken down by the Type of Job and the fiscal year it was done.

I wish to first count how many jobs fit a specific job type. This was easily done:

=COUNTIF(Data!A2:A4121,A7)

A7 = Medical
A1:A4121 = the range of the names.

Count comes up as 346, which is correct.

I then want to add another parameter to break up the 346 by fiscal year. It ranges from 05-06 to 08-09. I came up with this:

=COUNTIF(Data!A2:A4121,A7)-COUNTIF(Data!F2:F4121,"9????")

Since the job # correlates to the fiscal year it was created, anything starting with 9 is a job done in 08-09. Anything starting with an 8 would be of course 07-08 range. I would have multiple fields with each different fiscal year.

However, when I put the 2nd formula in the function didn't work. It keeps the count at 346, which I know is wrong. I am not sure if I did something wrong here. Been looking at this for an hour and can't figure out what is wrong. The jobs that are medical within 08-09 fiscal year should be 120, but it keeps at 346.

Any help would be superb.
Reply With Quote
  #2  
Old 06-18-2009, 10:19 AM
NBVC's Avatar
NBVC NBVC is offline
Forum Guru
 
Join Date: 06 Dec 2006
Location: Mississauga, CANADA
MS Office Version:2003 & 2007
Posts: 18,489
NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future
Re: CountIF multiple parameters

is the field starting with "9" text field?

if yes,

=COUNTIF(Data!A2:A4121,A7)-COUNTIF(Data!F2:F4121,"9*")

may work.
__________________
Where there is a will there are many ways. Pick One!

Please read the Forum Rules

If you are happy with the results, please add to my reputation by clicking the icon next to the Post # in the bar above my avatar (picture) in this post.

Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Reply With Quote
  #3  
Old 06-18-2009, 10:21 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

Quote:
Originally Posted by NBVC View Post
is the field starting with "9" text field?

if yes,

=COUNTIF(Data!A2:A4121,A7)-COUNTIF(Data!F2:F4121,"9*")

may work.
Ha, too quick, I realized I posted this in the wrong section of the forums. One moment...
Reply With Quote
  #4  
Old 06-18-2009, 10:24 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

Quote:
Originally Posted by NBVC View Post
is the field starting with "9" text field?

if yes,

=COUNTIF(Data!A2:A4121,A7)-COUNTIF(Data!F2:F4121,"9*")

may work.
Changed the field to a text field and changed it instead of 4 question marks to a star, but no luck, still displaying the original count of all the medical stuff.

P.S. don't ban me, I misread this section of the forums :P
Reply With Quote
  #5  
Old 06-18-2009, 10:33 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

If you want I can stop this thread and put it in its appropriate location :P
Reply With Quote
  #6  
Old 06-18-2009, 10:34 AM
NBVC's Avatar
NBVC NBVC is offline
Forum Guru
 
Join Date: 06 Dec 2006
Location: Mississauga, CANADA
MS Office Version:2003 & 2007
Posts: 18,489
NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future
Re: CountIF multiple parameters

Try then:

=SUMPRODUCT(--Data!A2:A4121=A7),--(LEFT(Data!F2:F4121)="9"))

P.S. I will move thread for you.
__________________
Where there is a will there are many ways. Pick One!

Please read the Forum Rules

If you are happy with the results, please add to my reputation by clicking the icon next to the Post # in the bar above my avatar (picture) in this post.

Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Reply With Quote
  #7  
Old 06-18-2009, 10:44 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

Quote:
Originally Posted by NBVC View Post
Try then:

=SUMPRODUCT(--Data!A2:A4121=A7),--(LEFT(Data!F2:F4121)="9"))

P.S. I will move thread for you.
Gave me a #Value! Error. I added an extra Parenthesis after SUMPRODUCT, excel shot my an error back. Are the double negative signs needed?
Reply With Quote
  #8  
Old 06-18-2009, 10:50 AM
NBVC's Avatar
NBVC NBVC is offline
Forum Guru
 
Join Date: 06 Dec 2006
Location: Mississauga, CANADA
MS Office Version:2003 & 2007
Posts: 18,489
NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future
Re: CountIF multiple parameters

Should've been:

=SUMPRODUCT(--(Data!A2:A4121=A7),--(LEFT(Data!F2:F4121)="9"))

If still no good.. please post sample workbook.
__________________
Where there is a will there are many ways. Pick One!

Please read the Forum Rules

If you are happy with the results, please add to my reputation by clicking the icon next to the Post # in the bar above my avatar (picture) in this post.

Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Reply With Quote
  #9  
Old 06-18-2009, 10:54 AM
rwgrietveld's Avatar
rwgrietveld rwgrietveld is online now
Forum Guru
 
Join Date: 02 Sep 2008
Location: Netherlands
MS Office Version:XL 2007 / XL 2010
Posts: 1,635
rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability rwgrietveld is very confident of their ability
Re: CountIF multiple parameters

I always like the solution with SUMPRODUCT. I do see a small error in the formula:

Code:
=SUMPRODUCT(--(Data!A2:A4121=Data!A7),--(LEFT(Data!F2:F4121)="9"))
I see that it was changed already. This message becomes obsolete.
__________________
Looking for great solutions but hate waiting?
Seach this Forum through Google

www.Google.com
(e.g. +multiple +IF site:excelforum.com/excel-general/ )

www.Google.com
(e.g. +fill +combobox site:excelforum.com/excel-programming/ )

Ave,
Ricardo

Last edited by rwgrietveld; 06-18-2009 at 10:57 AM.
Reply With Quote
  #10  
Old 06-18-2009, 10:57 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

coming up with 0 as the value now. Meeting in 2 minutes, going to upload the workbook when I get back.
Reply With Quote
  #11  
Old 06-18-2009, 11:09 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

Nevermind, meeting canceled. Figures the meeting that only requires 5 seconds of input from myself gets canceled....

Took out a lot of the un-necessary info and put in specifically whats needed. To be clear:

The A range is the same, but switch F columns to C for this workbook.

The numbers inbetween the name and the Job number are there for a specific reason. 10,11,12 and all numbers above 30 are specific products. However, 30 itself is a mash of many types of products, so that is why I am trying to sort by name, not by number. And as you can tell I am not done categorizing product code 30 by name.
Attached Files
File Type: xls Small_Press_Analysis_Skeleton.xls (491.0 KB, 1 views)
Reply With Quote
  #12  
Old 06-18-2009, 11:14 AM
NBVC's Avatar
NBVC NBVC is offline
Forum Guru
 
Join Date: 06 Dec 2006
Location: Mississauga, CANADA
MS Office Version:2003 & 2007
Posts: 18,489
NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future
Re: CountIF multiple parameters

It worked for me...

I get 38...

I put "Medical" in M1 to refer to it.. and formula in N1
Attached Files
File Type: xls Small_Press_Analysis_Skeleton.xls (494.5 KB, 4 views)
__________________
Where there is a will there are many ways. Pick One!

Please read the Forum Rules

If you are happy with the results, please add to my reputation by clicking the icon next to the Post # in the bar above my avatar (picture) in this post.

Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Reply With Quote
  #13  
Old 06-18-2009, 11:16 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

Quote:
Originally Posted by NBVC View Post
It worked for me...

I get 38...

I put "Medical" in M1 to refer to it.. and formula in N1
That is screwed up....

Give me 5 minutes, I want to try it on my original excel spreadsheet
Reply With Quote
  #14  
Old 06-18-2009, 11:25 AM
Karroog Karroog is offline
Registered User
 
Join Date: 08 Aug 2007
Posts: 32
Karroog is becoming part of the community
Re: CountIF multiple parameters

Quote:
Originally Posted by Karroog View Post
That is screwed up....

Give me 5 minutes, I want to try it on my original excel spreadsheet
Found it:

In the original spreadsheet there are a lot of spacing issues because I imported the excel sheet off of a data sheet from a program called Crystal Report. It has a tendency to mesh all the fields together to look good on a printout. The original function I had F as the area, but it was actually D. That's why it wasn't working.

And the 38 for medical, I just can't count this morning :P

Thanks again!
Reply With Quote
  #15  
Old 06-18-2009, 11:35 AM
NBVC's Avatar
NBVC NBVC is offline
Forum Guru
 
Join Date: 06 Dec 2006
Location: Mississauga, CANADA
MS Office Version:2003 & 2007
Posts: 18,489
NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future NBVC has a brilliant future
Re: CountIF multiple parameters

If you are satisfied with the solution(s) provided, please mark your thread as Solved.

How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
__________________
Where there is a will there are many ways. Pick One!

Please read the Forum Rules

If you are happy with the results, please add to my reputation by clicking the icon next to the Post # in the bar above my avatar (picture) in this post.

Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump