Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default Adding columns using dates, but getting wrong data


A B C

1/9/08 7
1/9/08 8 7
1/9/08 3 3
1/10/08 5
1/10/08 10 7

If column A and B are my data and I use the following formula to calculate
the hours of OT for each day =SUMIF($A$2:$A2,A2,B$2:B2)-8 to get the totals.
How do I get it to only give me the hours over 8 for each day and not the
totals.
With the above formula I am getting -1, 7, 10, -3, 7 I need to get the
totals as above.

Any suggestions

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Adding columns using dates, but getting wrong data

In C2:
=IF(SUMIF($A$2:$A2,A2,B$2:B2)8,SUMIF($A$2:$A2,A2, B$2:B2)-8,"")

In D2:
=IF(SUMIF($A$2:$A3,A3,B$2:B3)8,SUMIF($A$2:$A3,A3, B$2:B3)-8-SUM(C2),"")
Copy D2 down
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,000 Files:370 Subscribers:66
xdemechanik
---
"Griffey5" wrote:

A B C

1/9/08 7
1/9/08 8 7
1/9/08 3 3
1/10/08 5
1/10/08 10 7

If column A and B are my data and I use the following formula to calculate
the hours of OT for each day =SUMIF($A$2:$A2,A2,B$2:B2)-8 to get the totals.
How do I get it to only give me the hours over 8 for each day and not the
totals.
With the above formula I am getting -1, 7, 10, -3, 7 I need to get the
totals as above.

Any suggestions

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Adding columns using dates, but getting wrong data

Pl dismiss the earlier suggestion
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,000 Files:370 Subscribers:66
xdemechanik
---


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Adding columns using dates, but getting wrong data

This seems to do what you want:

Enter this formula in C2:

=MAX(0,B2-8)

Enter this formula in C3 and copy down as needed:

=MAX(SUMIF(A$2:A3,A3,B$2:B3)-8-SUMIF(A$2:A2,A3,C$2:C2),0)

Some of these formulas will return zeros. If you want to hide them one way
is to use a custom number format:

Select the entire range of formulas
Goto the menu FormatCellsNumber tab
Select Custom and enter this code in the little box below where it says
Type:

General;General;;@

OK out

Note that the cells will still contain a numeric 0, you just won't see them.
You should be aware of that if you need to do further calculations on this
data where zeros may have to be accounted for.

--
Biff
Microsoft Excel MVP


"Griffey5" wrote in message
...

A B C

1/9/08 7
1/9/08 8 7
1/9/08 3 3
1/10/08 5
1/10/08 10 7

If column A and B are my data and I use the following formula to calculate
the hours of OT for each day =SUMIF($A$2:$A2,A2,B$2:B2)-8 to get the
totals.
How do I get it to only give me the hours over 8 for each day and not the
totals.
With the above formula I am getting -1, 7, 10, -3, 7 I need to get the
totals as above.

Any suggestions



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
adding columns if the dates are the same and getting OT hours Griffey5 Excel Worksheet Functions 1 January 7th 09 12:58 AM
adding columns if dates are the same Griffey5 Excel Worksheet Functions 4 January 6th 09 11:41 PM
Adding Data That Lies Between Two Dates Bazy2k Excel Discussion (Misc queries) 1 December 12th 08 10:43 AM
Adding Column of mixed data omitting the dates lpullen Excel Discussion (Misc queries) 2 November 17th 05 04:40 PM
Exported Data to excel appearing wrong in Columns lwreece Excel Discussion (Misc queries) 4 March 10th 05 11:03 PM


All times are GMT +1. The time now is 08:35 AM.

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"