#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default count if

hi im using excel 2003. How would i count the number of "Lates" for each
individual. here is my data:
sheet1:
name Attendance
karen late
bryan late
karen late
bryan
ferdy

Sheet2:
name # of Lates
karen 2
bryan 1
ferdy 0
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default count if

Hi,

=SUMPRODUCT(--(Sheet1!A$2:A$20=A2),--(Sheet1!B$2:B$20="Late"))

Assuming titles on the first row in both sheets.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"newbie_010108" wrote:

hi im using excel 2003. How would i count the number of "Lates" for each
individual. here is my data:
sheet1:
name Attendance
karen late
bryan late
karen late
bryan
ferdy

Sheet2:
name # of Lates
karen 2
bryan 1
ferdy 0

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default count if

Try this:

Entered on sheet2 B2 then copied down as needed:

=SUMPRODUCT(--(Sheet1!A$2:A$10=A2),--(Sheet1!B$2:B$10="late"))

--
Biff
Microsoft Excel MVP


"newbie_010108" wrote in message
...
hi im using excel 2003. How would i count the number of "Lates" for each
individual. here is my data:
sheet1:
name Attendance
karen late
bryan late
karen late
bryan
ferdy

Sheet2:
name # of Lates
karen 2
bryan 1
ferdy 0



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default count if

hi shane,
it works! perfect! just curious.. why is it needs to be =sumproduct? and
what is -- for? and why is it need to have a dollar sign?.. i thought it
should be count if function....
your so great!
thanks!

"Shane Devenshire" wrote:

Hi,

=SUMPRODUCT(--(Sheet1!A$2:A$20=A2),--(Sheet1!B$2:B$20="Late"))

Assuming titles on the first row in both sheets.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"newbie_010108" wrote:

hi im using excel 2003. How would i count the number of "Lates" for each
individual. here is my data:
sheet1:
name Attendance
karen late
bryan late
karen late
bryan
ferdy

Sheet2:
name # of Lates
karen 2
bryan 1
ferdy 0

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default count if

Hi,

1. SUMPRODUCT is used instead of entering the formula as an array because
they calculate faster, and don't require array entry.
2. You are doing a count in this case, even though the function is
SUM-PRODUCT. The Sheet1!A$2:A$20=A2 portion of the formula returns an array
of the form
{TRUE,FALSE,FALSE,TRUE,....}
When you use -- this converts the TRUE's to 1 and the FALSE's to 0
The second portion of the formula, Sheet1!B$2:B$20="Late" works the same
way. The SUMPRODUCT function multiplies the elements of the two arrays
together and then sums them:
{1,0,0,1,.....} times {1,1,0,0,......} = {1,0,0,0,........}
a 1 times a 1 is 1 all other combinations return 0. When you some these you
are summing those items that met both conditions, you are summing all the
1's. Which give you the count of the number that met both conditions.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"newbie_010108" wrote:

hi shane,
it works! perfect! just curious.. why is it needs to be =sumproduct? and
what is -- for? and why is it need to have a dollar sign?.. i thought it
should be count if function....
your so great!
thanks!

"Shane Devenshire" wrote:

Hi,

=SUMPRODUCT(--(Sheet1!A$2:A$20=A2),--(Sheet1!B$2:B$20="Late"))

Assuming titles on the first row in both sheets.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"newbie_010108" wrote:

hi im using excel 2003. How would i count the number of "Lates" for each
individual. here is my data:
sheet1:
name Attendance
karen late
bryan late
karen late
bryan
ferdy

Sheet2:
name # of Lates
karen 2
bryan 1
ferdy 0



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default count if

amazing! thanks!

"Shane Devenshire" wrote:

Hi,

1. SUMPRODUCT is used instead of entering the formula as an array because
they calculate faster, and don't require array entry.
2. You are doing a count in this case, even though the function is
SUM-PRODUCT. The Sheet1!A$2:A$20=A2 portion of the formula returns an array
of the form
{TRUE,FALSE,FALSE,TRUE,....}
When you use -- this converts the TRUE's to 1 and the FALSE's to 0
The second portion of the formula, Sheet1!B$2:B$20="Late" works the same
way. The SUMPRODUCT function multiplies the elements of the two arrays
together and then sums them:
{1,0,0,1,.....} times {1,1,0,0,......} = {1,0,0,0,........}
a 1 times a 1 is 1 all other combinations return 0. When you some these you
are summing those items that met both conditions, you are summing all the
1's. Which give you the count of the number that met both conditions.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"newbie_010108" wrote:

hi shane,
it works! perfect! just curious.. why is it needs to be =sumproduct? and
what is -- for? and why is it need to have a dollar sign?.. i thought it
should be count if function....
your so great!
thanks!

"Shane Devenshire" wrote:

Hi,

=SUMPRODUCT(--(Sheet1!A$2:A$20=A2),--(Sheet1!B$2:B$20="Late"))

Assuming titles on the first row in both sheets.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"newbie_010108" wrote:

hi im using excel 2003. How would i count the number of "Lates" for each
individual. here is my data:
sheet1:
name Attendance
karen late
bryan late
karen late
bryan
ferdy

Sheet2:
name # of Lates
karen 2
bryan 1
ferdy 0

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
Count Employee Work Time - Don't Double-count Overlapping Apts. J Excel Worksheet Functions 0 April 27th 07 05:52 AM
Excel 2000, count, sort a list & count totals? sunslight Excel Worksheet Functions 1 April 9th 07 05:46 PM
Count Intervals of 1 Numeric value in a Row and Return Count down Column Sam via OfficeKB.com Excel Worksheet Functions 8 October 4th 05 04:37 PM
Count Intervals of 2 Numeric values in same Row and Return Count across Row Sam via OfficeKB.com Excel Worksheet Functions 12 September 24th 05 10:58 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM


All times are GMT +1. The time now is 07:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"