Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Annual Timesheet: Two date ranges lookup in a single sum column

hello,

Below is the annual timesheet requirement, and I need it preferrably in
Excel formula (if not VBA, will also do)

Sheet 1:
Date Day Hours Remarks
1/1/06 Sun 0
1/2/06 Mon 0 New Years Day Holiday
1/3/06 Tue 8
1/4/06 Wed 8
1/5/06 Thu 8
1/6/06 Fri 8
1/7/06 Sat 0
1/8/06 Sun 0
1/9/06 Mon 8
....
....and so on

Sheet 2:
Begin End Total hours
1/2/06 1/15/06 72
1/16/06 1/29/06 80
....
....and so on

What I am looking here is, In sheet 2, Total hours should be calculated
based on looking up Begin and End dates from sheet 2 in sheet 1 and
then computing sum for that range. For example, the formula should
lookup the range of dates 1/2/06 and 1/15/06 in sheet 1 and compute the
sum as 72.

Appreciate your quick response.

-King

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Annual Timesheet: Two date ranges lookup in a single sum column

=sumif(Sheet1!A:A,"="&A2,Sheet1!C:C) - Sumif(Sheet1!A:A,""&B2,Sheet1!C:C)
in C2
then drag fill down column C of Sheet2

--
Regards,
Tom Ogilvy


"king" wrote in message
oups.com...
hello,

Below is the annual timesheet requirement, and I need it preferrably in
Excel formula (if not VBA, will also do)

Sheet 1:
Date Day Hours Remarks
1/1/06 Sun 0
1/2/06 Mon 0 New Years Day Holiday
1/3/06 Tue 8
1/4/06 Wed 8
1/5/06 Thu 8
1/6/06 Fri 8
1/7/06 Sat 0
1/8/06 Sun 0
1/9/06 Mon 8
...
...and so on

Sheet 2:
Begin End Total hours
1/2/06 1/15/06 72
1/16/06 1/29/06 80
...
...and so on

What I am looking here is, In sheet 2, Total hours should be calculated
based on looking up Begin and End dates from sheet 2 in sheet 1 and
then computing sum for that range. For example, the formula should
lookup the range of dates 1/2/06 and 1/15/06 in sheet 1 and compute the
sum as 72.

Appreciate your quick response.

-King



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Annual Timesheet: Two date ranges lookup in a single sum column

Tom,

Thanks a lot !! It worked just fine....

Regards,
King

Tom Ogilvy wrote:
=sumif(Sheet1!A:A,"="&A2,Sheet1!C:C) - Sumif(Sheet1!A:A,""&B2,Sheet1!C:C)
in C2
then drag fill down column C of Sheet2

--
Regards,
Tom Ogilvy


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
sorting ranges of various column lengths, lookup values in columns mrphinney Excel Worksheet Functions 0 May 14th 09 07:51 PM
Financial rear date ranges in a single cell Glen Excel Discussion (Misc queries) 2 April 29th 09 06:51 AM
Matching two column ranges with a date Data Analyst Excel Worksheet Functions 4 November 2nd 07 06:02 PM
date in column.. need to put in a single row mithu Excel Discussion (Misc queries) 1 April 23rd 07 09:10 PM
TIMESHEET LOOKUP smonsmo Excel Discussion (Misc queries) 1 February 8th 07 12:00 AM


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