Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default Calculate the number of weeksdays based on a cell value

Hi,

I wish to calculate the number of weekdays a project is recorded
against. In my list I can have multiple of the same weekday for a
specific project and task but I wish excel to only calculate it as 1
day for example:

Mon 1-Dec-08 Artwork Draw
Mon 1-Dec-08 Artwork Paint
Tue 2-Dec-08
Wed 3-Dec-08 Artwork Paint

Artwork was actually completed over 2 days not 3 how do I get excel to
calculate 2 days and not 3?

Thanks soo much!
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Calculate the number of weeksdays based on a cell value

On Sat, 20 Dec 2008 21:03:09 -0500, smartin wrote:

wrote:
Hi,

I wish to calculate the number of weekdays a project is recorded
against. In my list I can have multiple of the same weekday for a
specific project and task but I wish excel to only calculate it as 1
day for example:

Mon 1-Dec-08 Artwork Draw
Mon 1-Dec-08 Artwork Paint
Tue 2-Dec-08
Wed 3-Dec-08 Artwork Paint

Artwork was actually completed over 2 days not 3 how do I get excel to
calculate 2 days and not 3?

Thanks soo much!


This array-entered* formula will do it:
=SUM(IF(C1:C4="Artwork",1/COUNTIF(B1:B4,B1:B4)))

*commit array formulae with Ctrl+Shift+Enter, not just Enter.

Much more on counting distinct/unique values can be found he
http://www.mrexcel.com/forum/showthread.php?t=70835


With a slight change in the data, your formula returns what I think is an
incorrect result:

Monday, December 01, 2008 Artwork Draw
Monday, December 01, 2008 Construction Paint
Tuesday, December 02, 2008
Wednesday, December 03, 2008 Artwork Paint

Your formula, with this data, should still return 2, if I understand the
question. However, it returns 1.5
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Calculate the number of weeksdays based on a cell value

Ron Rosenfeld wrote:
On Sat, 20 Dec 2008 21:03:09 -0500, smartin wrote:

wrote:
Hi,

I wish to calculate the number of weekdays a project is recorded
against. In my list I can have multiple of the same weekday for a
specific project and task but I wish excel to only calculate it as 1
day for example:

Mon 1-Dec-08 Artwork Draw
Mon 1-Dec-08 Artwork Paint
Tue 2-Dec-08
Wed 3-Dec-08 Artwork Paint

Artwork was actually completed over 2 days not 3 how do I get excel to
calculate 2 days and not 3?

Thanks soo much!

This array-entered* formula will do it:
=SUM(IF(C1:C4="Artwork",1/COUNTIF(B1:B4,B1:B4)))

*commit array formulae with Ctrl+Shift+Enter, not just Enter.

Much more on counting distinct/unique values can be found he
http://www.mrexcel.com/forum/showthread.php?t=70835


With a slight change in the data, your formula returns what I think is an
incorrect result:

Monday, December 01, 2008 Artwork Draw
Monday, December 01, 2008 Construction Paint
Tuesday, December 02, 2008
Wednesday, December 03, 2008 Artwork Paint

Your formula, with this data, should still return 2, if I understand the
question. However, it returns 1.5
--ron


Ah, right you are.

Here's a work-around, though I was hoping to avoid a helper formula.
Maybe there's a better way?

With a helper formula in column E where E1=B1&C1 this seems to sort it out:

=SUM(IF($C1:$C4="Artwork",1/COUNTIF(E1:E4,E1:E4)))

Thanks for pointing that out.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Calculate the number of weeksdays based on a cell value

To count the unique dates (or numbers) that meet a condition (correspond to
artwork):

Array entered** :

=COUNT(1/FREQUENCY(IF(C1:C4="artwork",B1:B4),B1:B4))

=SUM(--(FREQUENCY(IF(C1:C4="artwork",B1:B4),B1:B4)0))

=SUM(IF(FREQUENCY(IF(C1:C4="artwork",B1:B4),B1:B4) ,1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"smartin" wrote in message
...
Ron Rosenfeld wrote:
On Sat, 20 Dec 2008 21:03:09 -0500, smartin wrote:

wrote:
Hi,

I wish to calculate the number of weekdays a project is recorded
against. In my list I can have multiple of the same weekday for a
specific project and task but I wish excel to only calculate it as 1
day for example:

Mon 1-Dec-08 Artwork Draw
Mon 1-Dec-08 Artwork Paint
Tue 2-Dec-08
Wed 3-Dec-08 Artwork Paint

Artwork was actually completed over 2 days not 3 how do I get excel to
calculate 2 days and not 3?

Thanks soo much!
This array-entered* formula will do it:
=SUM(IF(C1:C4="Artwork",1/COUNTIF(B1:B4,B1:B4)))

*commit array formulae with Ctrl+Shift+Enter, not just Enter.

Much more on counting distinct/unique values can be found he
http://www.mrexcel.com/forum/showthread.php?t=70835


With a slight change in the data, your formula returns what I think is an
incorrect result:

Monday, December 01, 2008 Artwork Draw
Monday, December 01, 2008 Construction Paint
Tuesday, December 02, 2008 Wednesday, December 03, 2008 Artwork Paint

Your formula, with this data, should still return 2, if I understand the
question. However, it returns 1.5
--ron


Ah, right you are.

Here's a work-around, though I was hoping to avoid a helper formula. Maybe
there's a better way?

With a helper formula in column E where E1=B1&C1 this seems to sort it
out:

=SUM(IF($C1:$C4="Artwork",1/COUNTIF(E1:E4,E1:E4)))

Thanks for pointing that out.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 54
Default Calculate the number of weeksdays based on a cell value

On Dec 21, 2:04*pm, "T. Valko" wrote:
To count the unique dates (or numbers) that meet a condition (correspond to
artwork):

Array entered** :

=COUNT(1/FREQUENCY(IF(C1:C4="artwork",B1:B4),B1:B4))

=SUM(--(FREQUENCY(IF(C1:C4="artwork",B1:B4),B1:B4)0))

=SUM(IF(FREQUENCY(IF(C1:C4="artwork",B1:B4),B1:B4) ,1))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP

"smartin" wrote in message

...

Ron Rosenfeld wrote:
On Sat, 20 Dec 2008 21:03:09 -0500, smartin wrote:


wrote:
Hi,


I wish to calculate the number of weekdays a project is recorded
against. In my list I can have multiple of the same weekday for a
specific project and task but I wish excel to only calculate it as 1
day for example:


Mon * *1-Dec-08 * * Artwork * * Draw
Mon * *1-Dec-08 * * Artwork * * Paint
Tue * * 2-Dec-08
Wed * 3-Dec-08 * * Artwork * * *Paint


Artwork was actually completed over 2 days not 3 how do I get excel to
calculate 2 days and not 3?


Thanks soo much!
This array-entered* formula will do it:
=SUM(IF(C1:C4="Artwork",1/COUNTIF(B1:B4,B1:B4)))


*commit array formulae with Ctrl+Shift+Enter, not just Enter.


Much more on counting distinct/unique values can be found he
http://www.mrexcel.com/forum/showthread.php?t=70835


With a slight change in the data, your formula returns what I think is an
incorrect result:


Monday, December 01, 2008 Artwork Draw
Monday, December 01, 2008 Construction Paint
Tuesday, December 02, 2008 Wednesday, December 03, 2008 Artwork Paint


Your formula, with this data, should still return 2, if I understand the
question. *However, it returns 1.5
--ron


Ah, right you are.


Here's a work-around, though I was hoping to avoid a helper formula. Maybe
there's a better way?


With a helper formula in column E where E1=B1&C1 this seems to sort it
out:


=SUM(IF($C1:$C4="Artwork",1/COUNTIF(E1:E4,E1:E4)))


Thanks for pointing that out.


Thanks everyone for giving me solutions! I used Biff's COUNT formula
and it worked!
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
Calculate Percentage Based On Number GoodTrouble Excel Discussion (Misc queries) 8 February 8th 08 06:03 PM
IF statement to calculate based on cell values Jos Excel Worksheet Functions 7 January 30th 07 03:38 PM
Function to calculate based on a portions of a number Sparky13 Excel Worksheet Functions 6 September 20th 06 02:56 PM
Calculate a 30-day moving average based on the last x number of entries and date gimiv Excel Worksheet Functions 14 July 7th 06 12:49 PM
Calculate number based on percentage [email protected] Excel Worksheet Functions 12 October 26th 05 01:49 AM


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