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 07-01-2009, 07:16 PM
doodlealien doodlealien is offline
Registered User
 
Join Date: 01 Jul 2009
Location: California
MS Office Version:Excel 2003
Posts: 3
doodlealien is becoming part of the community
Question Find Specific Days for Referance to Formula

Please Register to Remove these Ads

Hello,

I have a column with dates for a month in descending order. I have another column where I manually enter values of work received on those days. Now, I want to create a formula that locates each Monday, then refers to the column immediatly to the right of the date in order to return a daily average of work received.

The reason I want to do this is because I create a new worksheet each month and it would save me a lot of time of manually changing my formula and picking out each Monday by hand.

Example :

Monday 46
Tuesday 77
Wednesday 12
Monday 36

I need the formula to automatically find the 46, 36, then return an average. Thank you!
Reply With Quote
  #2  
Old 07-01-2009, 07:25 PM
daddylonglegs's Avatar
daddylonglegs daddylonglegs is offline
Forum Moderator
 
Join Date: 14 Jan 2006
Location: England
MS Office Version:2002 (work), 2003 & 2007 (home)
Posts: 6,565
daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding
Re: Find Specific Days for Referance to Formula

If A2:A32 contains dates and B2:B32 contains amounts you can get an average for monday by using the formula

=AVERAGE(IF(WEEKDAY(A2:A32)=2,B2:B32))

This is an array formula that needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces appear around the formula in the formula bar

Change the 2 to a 3 for Tuesday etc.

If A2:A32 actually contains the day, e.g. "Saturday", "Monday" etc.you can use this formula

=SUMIF(A2:A32,"Monday",B2:B32)/COUNTIF(A2:A32,"Monday")
Reply With Quote
  #3  
Old 07-01-2009, 07:52 PM
doodlealien doodlealien is offline
Registered User
 
Join Date: 01 Jul 2009
Location: California
MS Office Version:Excel 2003
Posts: 3
doodlealien is becoming part of the community
Re: Find Specific Days for Reference to Formula

Amazing! This worked like a charm, thanks a bunch! The CNTL-SHIFt-ENTER thing is a little strange but I can get used to it.

Also, one more quick question if you don't mind. Sometimes in the case of holidays, I remove a row of data, which removes the date and tally. All of the formulas based on this recover from this deletion except for my date formula which is used to remove Sundays and fill series.

=IF(WEEKDAY(C4)=7,C4+2,C4+1)

I enter 1/1/2009 in the first cell and it automatically fills out the month skipping sundays. When I remove a line, obviously the remaining days freak out. Any help in keeping the series in tact, skipping sundays and the lines I remove? Thank you!
Reply With Quote
  #4  
Old 07-01-2009, 08:06 PM
daddylonglegs's Avatar
daddylonglegs daddylonglegs is offline
Forum Moderator
 
Join Date: 14 Jan 2006
Location: England
MS Office Version:2002 (work), 2003 & 2007 (home)
Posts: 6,565
daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding
Re: Find Specific Days for Referance to Formula

Rather than deleting rows why don't you list all your holidays somewhere, e.g. H1:H10 then make your formula to generate the dates this in C5 copied down

=MIN(IF(WEEKDAY(C4)+{1,2,3,4,5}<>1,IF(ISNA(MATCH(C4+{1,2,3,4,5},H$1:H$10,0)),C4+{1,2,3,4,5})))

This will ignore all Sundays and those dates listed in H1:H10

Assumes that you never have 5 consecutive holidays/Sundays
Reply With Quote
  #5  
Old 07-11-2009, 07:29 PM
doodlealien doodlealien is offline
Registered User
 
Join Date: 01 Jul 2009
Location: California
MS Office Version:Excel 2003
Posts: 3
doodlealien is becoming part of the community
Talking Re: Find Specific Days for Referance to Formula

Sorry for the long reply.

The above formula you created for me works great for removing holidays so thank you for solving that problem for me.

You mentioned that it would remove sundays as well, did you mean that I should manually enter the sundays in with the holidays or should the formula automatically remove them for me? Currently, the formula won't automatically remove them, was wondering if there is a way for it to do so. Thanks again!
Reply With Quote
  #6  
Old 07-12-2009, 12:35 PM
daddylonglegs's Avatar
daddylonglegs daddylonglegs is offline
Forum Moderator
 
Join Date: 14 Jan 2006
Location: England
MS Office Version:2002 (work), 2003 & 2007 (home)
Posts: 6,565
daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding daddylonglegs Has a higher level of understanding
Re: Find Specific Days for Referance to Formula

Apologies, I misplaced a parenthesis. Try this version

=MIN(IF(WEEKDAY(C4+{1,2,3,4,5})<>1,IF(ISNA(MATCH(C4+{1,2,3,4,5},H$1:H$10,0)),C4+{1,2,3,4,5})))

You only have to list holidays in the holiday range. This version should correctly list all dates except Sundays and holidays.......
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