Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tj tj is offline
external usenet poster
 
Posts: 71
Default COUNTIF Function with variables

I have a spreadsheet that records the initials of a stage check airman in one
column, the next column can be marked with an X if the student fails the oral
portion, the next column marked with an X if they fail the flight portion. I
want to count the number of times the initials are found with no X's in
either column (which means the student passed the check) and also count the
number of times the initials are found with either column having an X in it.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,533
Default COUNTIF Function with variables

Hi

With initials and fails in columns A:C and a table of unique initials in
column H this formula will return the number of passed tests:

=SUMPRODUCT(($A$2:$A$100=H2)*1,($B$2:$B$100="")*1, ($C$2:$C$100="")*1)

And this will return the number of faild tests. A test will count as one if
either or both tests in same row is failed:

=SUMPRODUCT(($A$2:$A$100=H2)*1,($B$2:$B$100="X")*1 )+SUMPRODUCT(($A$2:$A$100=H2)*1,($C$2:$C$100="X")* 1)-SUMPRODUCT(($A$2:$A$100=H2)*1,($B$2:$B$100="X")*1, ($C$2:$C$100="X")*1)

The formula is to be entered as one line.

Regards,
Per

"TJ" skrev i meddelelsen
...
I have a spreadsheet that records the initials of a stage check airman in
one
column, the next column can be marked with an X if the student fails the
oral
portion, the next column marked with an X if they fail the flight portion.
I
want to count the number of times the initials are found with no X's in
either column (which means the student passed the check) and also count
the
number of times the initials are found with either column having an X in
it.

Any suggestions?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default COUNTIF Function with variables

=SUMPRODUCT(--($A$2:$A$20="RP"),--(($B$2:$B$20="")+($C$2:$C$20="")=2))

and

=SUMPRODUCT(--($A$2:$A$20="RP"),--(SIGN(($B$2:$B$20="X")+($C$2:$C$20="X"))))

--
__________________________________
HTH

Bob

"Per Jessen" wrote in message
...
Hi

With initials and fails in columns A:C and a table of unique initials in
column H this formula will return the number of passed tests:

=SUMPRODUCT(($A$2:$A$100=H2)*1,($B$2:$B$100="")*1, ($C$2:$C$100="")*1)

And this will return the number of faild tests. A test will count as one
if either or both tests in same row is failed:

=SUMPRODUCT(($A$2:$A$100=H2)*1,($B$2:$B$100="X")*1 )+SUMPRODUCT(($A$2:$A$100=H2)*1,($C$2:$C$100="X")* 1)-SUMPRODUCT(($A$2:$A$100=H2)*1,($B$2:$B$100="X")*1, ($C$2:$C$100="X")*1)

The formula is to be entered as one line.

Regards,
Per

"TJ" skrev i meddelelsen
...
I have a spreadsheet that records the initials of a stage check airman in
one
column, the next column can be marked with an X if the student fails the
oral
portion, the next column marked with an X if they fail the flight
portion. I
want to count the number of times the initials are found with no X's in
either column (which means the student passed the check) and also count
the
number of times the initials are found with either column having an X in
it.

Any suggestions?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tj tj is offline
external usenet poster
 
Posts: 71
Default One more wrinkle to add


Thanks!

Lets say I want to complicate this one more step and seperate the check
instructor stats into "initial check" pass and fail and also "recheck pass
and fail"

Currently I have each students columns set up as A column "date", B column
"Check Instructor Initials", C column "failed oral", D Column "failed
flight". I have three rows per student with the initial check in row 1 and
space for 2 re-checks in row 2 and 3 if necessary.

The formula given to me by Bob works perfectly to evaluate all the checks
the same. I assume I will have to add a hidden column E that puts an X in row
1 that tells the formula that that is the "initial check".

Do I have to add an array to the formula? I dont care about seperating out
recheck 1 and 2. Those can be tallied under the same recheck column.

Thanks for the help!
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default One more wrinkle to add

If it is always batched in groups of 3, you should be able to tell the
formula to look at only every third row. Just add this test

--(MOD(ROW($A$2:$A$20),3)=0)

to the formula.

I would give you the whole formula, but your data layout seems to have
changed, and I cannot see where the student initials are now, so I am
confused by it.

--
__________________________________
HTH

Bob

"TJ" wrote in message
...

Thanks!

Lets say I want to complicate this one more step and seperate the check
instructor stats into "initial check" pass and fail and also "recheck pass
and fail"

Currently I have each students columns set up as A column "date", B column
"Check Instructor Initials", C column "failed oral", D Column "failed
flight". I have three rows per student with the initial check in row 1 and
space for 2 re-checks in row 2 and 3 if necessary.

The formula given to me by Bob works perfectly to evaluate all the checks
the same. I assume I will have to add a hidden column E that puts an X in
row
1 that tells the formula that that is the "initial check".

Do I have to add an array to the formula? I dont care about seperating out
recheck 1 and 2. Those can be tallied under the same recheck column.

Thanks for the help!





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tj tj is offline
external usenet poster
 
Posts: 71
Default One more wrinkle to add


Unfortunately, I cannot do the every third row modification as there is the
occasional bone-head that takes 4 attempts at the check and I have to
manually add a fourth row.

Sorry for the confusion on the layout. It isnt really laid out the way I
said, I was just leaving out what I thought was the extra's. Here is the
columns from left to right: Student Name, Student ID Number, Student Start
Date, Date of stage 1 check, initials of check instructor that administered
the check, a box to put an X in if they failed the oral, a box to put an X in
if they failed the flight and then the next column is the date of the stage 2
check and it continues on until column CC for all the checks.

Rows 1-3 are merged in columns A,B and C and they are available for data in
D,E,F and G. Row 4 starts again with a new student.

The formula I am writing is on a different tab designed to track the stats
of my check instructors. It is in this tab that I have set up columns of
"name of check administered", "first attempt passed", "first attempt failed,
"recheck passed" and "recheck failed. The rows would be stage 1 check, stage
2 check and so on.

The formula you wrote helps if I have only two columns of pass and fail. If
I add a column H that puts an X in row 1 and leaves rows 2 and 3 blank, is
there a way to re-write the formula to separate out checks and re-checks?
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
COUNTIF with 2 variables. HOW??? Patrick Excel Worksheet Functions 4 November 16th 07 04:48 AM
countif two variables in two different columns Greg Diamond Excel Worksheet Functions 2 May 25th 05 07:58 PM
Countif function with variables SMANDA Excel Worksheet Functions 0 February 7th 05 10:46 PM
another thought on COUNTIF 2 VARIABLES ?? Alan Excel Worksheet Functions 1 November 27th 04 03:25 AM
COUNTIF ON 2 VARIABLES ?? Alan Excel Worksheet Functions 4 November 26th 04 08:10 PM


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