Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Outraged
 
Posts: n/a
Default Using a range of dates to add data in a different column?


I need to sum a range in a column based on the date in another column:
A B
1 Date Hours
2 05--Dec-26 7.2
3 05--Dec-29 6.8
4 06--Jan-01 2.1
5 06--Jan-12 3.3

essentially, i want to say "if the date in A is in Dec 05, add the
hours in B that correspond to Dec 05". so, in another cell, in another
sheet, i would get:

A B
1 Dec 05 14.0
2 Jan 06 5.4

B1 of the second sheet obviously where my formula would be.
Thanks.
-Carl Eubanks


--
Outraged
------------------------------------------------------------------------
Outraged's Profile: http://www.excelforum.com/member.php...o&userid=31491
View this thread: http://www.excelforum.com/showthread...hreadid=511703

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Philip J Smith
 
Posts: n/a
Default Using a range of dates to add data in a different column?

Hi Outraged.

Assuming that the dates are not just labels try the following
Name the column of Dates as "Date"
Name the column of Hours as "Hours"

Use the Menu Tools Add-ins and check Analysis ToolPak
Enter the following in cell B1.
=SUM(IF(DateEOMONTH(A1,-1),IF(Date<=EOMONTH(A1,0),Hours,0),0))
Press [Ctrl][Shift][Enter] to accept
The formula will then look like
{=SUM(IF(DateEOMONTH(A1,-1),IF(Date<=EOMONTH(A1,0),Hours,0),0))}
This is an array function.
Copy this formula down as far as you need.

Regards

Phil Smith

"Outraged" wrote:


I need to sum a range in a column based on the date in another column:
A B
1 Date Hours
2 05--Dec-26 7.2
3 05--Dec-29 6.8
4 06--Jan-01 2.1
5 06--Jan-12 3.3

essentially, i want to say "if the date in A is in Dec 05, add the
hours in B that correspond to Dec 05". so, in another cell, in another
sheet, i would get:

A B
1 Dec 05 14.0
2 Jan 06 5.4

B1 of the second sheet obviously where my formula would be.
Thanks.
-Carl Eubanks


--
Outraged
------------------------------------------------------------------------
Outraged's Profile: http://www.excelforum.com/member.php...o&userid=31491
View this thread: http://www.excelforum.com/showthread...hreadid=511703


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
Using a range of dates to add data in a different column? Outraged Excel Worksheet Functions 2 February 13th 06 02:06 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
convert text to number for a range of data in a column Tom Excel Discussion (Misc queries) 9 October 31st 05 11:28 PM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM
Can you average data in 1 column based on a range of values in another? kman24 Excel Worksheet Functions 2 November 17th 04 02:09 PM


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