Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Sumproduct vs countif

I am trying to count the # of times a value occurs in a column, the column
format is dd/mm/yyyy hh:mm AM/PM and i want to count all occurrences between
7am and 8am, 8-9, 9-10, etc and have utilized this formula

=SUMPRODUCT((HOUR($I$15:$I$350)=7)*(HOUR($I$15:$I $350)<8))

and it seems to work, however with the midnight to 1 am

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15:$I $350)<1))

it is returning the blank cells as well how can i adjust this to not count
the blank cells, also is there an easier countif formula that could do the
same thing?
Thank You
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Sumproduct vs countif

=SUMPRODUCT((HOUR($I$15:$I$350)0)*(HOUR($I$15:$I$ 350)<1))
--
Gary''s Student - gsnu200787
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Sumproduct vs countif

On Thu, 22 May 2008 12:06:01 -0700, Scott Kieta
wrote:

I am trying to count the # of times a value occurs in a column, the column
format is dd/mm/yyyy hh:mm AM/PM and i want to count all occurrences between
7am and 8am, 8-9, 9-10, etc and have utilized this formula

=SUMPRODUCT((HOUR($I$15:$I$350)=7)*(HOUR($I$15:$ I$350)<8))

and it seems to work, however with the midnight to 1 am

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15:$ I$350)<1))

it is returning the blank cells as well how can i adjust this to not count
the blank cells, also is there an easier countif formula that could do the
same thing?
Thank You


If you don't want to include the blank cells you can add an extra
multiplication, like this:

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15:$I $350)<1)*(NOT(ISBLANK($I$15:$I$350))))

Hope this helps / Lars-Åke
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Sumproduct vs countif

On Thu, 22 May 2008 19:41:07 GMT, Lars-Åke Aspelin
wrote:

On Thu, 22 May 2008 12:06:01 -0700, Scott Kieta
wrote:

I am trying to count the # of times a value occurs in a column, the column
format is dd/mm/yyyy hh:mm AM/PM and i want to count all occurrences between
7am and 8am, 8-9, 9-10, etc and have utilized this formula

=SUMPRODUCT((HOUR($I$15:$I$350)=7)*(HOUR($I$15: $I$350)<8))

and it seems to work, however with the midnight to 1 am

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15: $I$350)<1))

it is returning the blank cells as well how can i adjust this to not count
the blank cells, also is there an easier countif formula that could do the
same thing?
Thank You


If you don't want to include the blank cells you can add an extra
multiplication, like this:

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15:$ I$350)<1)*(NOT(ISBLANK($I$15:$I$350))))

Hope this helps / Lars-Åke



And you dont need both =0 and <1. Only =0 is needed, like this:

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(NOT(ISBLANK($I $15:$I$350))))

Lars-Åke

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Sumproduct vs countif

Hi Scott,

In addition you could use the shorter version

=countif(HOUR($I$15:$I$350)<1)


I'm assuming you don't have negative times.
--
Thanks,
Shane Devenshire


"Scott Kieta" wrote:

I am trying to count the # of times a value occurs in a column, the column
format is dd/mm/yyyy hh:mm AM/PM and i want to count all occurrences between
7am and 8am, 8-9, 9-10, etc and have utilized this formula

=SUMPRODUCT((HOUR($I$15:$I$350)=7)*(HOUR($I$15:$I $350)<8))

and it seems to work, however with the midnight to 1 am

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15:$I $350)<1))

it is returning the blank cells as well how can i adjust this to not count
the blank cells, also is there an easier countif formula that could do the
same thing?
Thank You



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Sumproduct vs countif

Thank you, worked like a charm

"Lars-Ã…ke Aspelin" wrote:

On Thu, 22 May 2008 19:41:07 GMT, Lars-Ã…ke Aspelin
wrote:

On Thu, 22 May 2008 12:06:01 -0700, Scott Kieta
wrote:

I am trying to count the # of times a value occurs in a column, the column
format is dd/mm/yyyy hh:mm AM/PM and i want to count all occurrences between
7am and 8am, 8-9, 9-10, etc and have utilized this formula

=SUMPRODUCT((HOUR($I$15:$I$350)=7)*(HOUR($I$15: $I$350)<8))

and it seems to work, however with the midnight to 1 am

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15: $I$350)<1))

it is returning the blank cells as well how can i adjust this to not count
the blank cells, also is there an easier countif formula that could do the
same thing?
Thank You


If you don't want to include the blank cells you can add an extra
multiplication, like this:

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(HOUR($I$15:$ I$350)<1)*(NOT(ISBLANK($I$15:$I$350))))

Hope this helps / Lars-Ã…ke



And you dont need both =0 and <1. Only =0 is needed, like this:

=SUMPRODUCT((HOUR($I$15:$I$350)=0)*(NOT(ISBLANK($I $15:$I$350))))

Lars-Ã…ke


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
Sumproduct or countif or both... peterpeter Excel Discussion (Misc queries) 3 April 2nd 08 04:54 AM
SumProduct and Countif Nycole Excel Worksheet Functions 5 February 19th 08 07:52 PM
sumproduct or countif dr350x Excel Discussion (Misc queries) 7 June 16th 07 03:27 PM
Countif or Sumproduct Harley Excel Discussion (Misc queries) 8 December 22nd 05 12:34 AM
countif, sumproduct mg New Users to Excel 7 July 1st 05 10:26 PM


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