MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 21st, 2002, 07:43 AM   #1
Username
New Member
 
Join Date: Mar 2002
Posts: 3
Default

No one could answer this yesterday, so it must be really hard. Only a true Excel genuis can help me...

I have a spreadsheet with one row per day.
Every day I record the time we start and stop painting, and when we change air filters. I need an elegant way to calculate how many production hours passed since the last filter change. We don't paint non-stop, the filter change time varies, and some days one or the other doesn't occur.

Date Start Stop Filter changed
3/08/02 6:00 AM 2:30 PM 12:50 PM
3/09/02 6:00 AM 12:30 PM None
3/10/02 No Production
3/11/02 6:00 AM 2:00 AM 6:00 AM
3/12/02 6:00 AM 2:00 AM 1:00 AM
3/13/02 6:00 AM 2:00 AM 4:00 PM
3/14/02 6:00 AM 2:00 AM None
3/15/02 6:00 AM 2:30 PM 11:00 AM
3/16/02 No Production
3/16/02 No Production
3/17/02 6:00 AM 2:00 AM 1:00 AM

Example results would be
3/13 filter changed after 9 hours
3/15 filter changed after 15 hours

I am using a nested IF/THEN, but there is not enough room to jump over more than 6 non-production days. I need to keep all the days, because I have other sheets linked by OFFSET formulas.

Thanks
John H.
Username is offline   Reply With Quote
Old Mar 21st, 2002, 08:30 AM   #2
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default


Is your example correct.
Are the times correct.
Start at 6: end at 2: is 20 hours?
Dave Patton is offline   Reply With Quote
Old Mar 21st, 2002, 09:15 AM   #3
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

I couldn't make sense of your data. It appears to be space delimited, but "No Production" contains a space. Couldn't figure out which column contained this value. If your values include spaces you should choose another delimiter such as a comma.
Mark W. is offline   Reply With Quote
Old Mar 21st, 2002, 10:53 AM   #4
Username
New Member
 
Join Date: Mar 2002
Posts: 3
Default

It looked great when I set it up, must be a variable sized font. I'll try again, delimited by ";"

We have two shifts. First shift is 5 days, 8 hrs/day, 6:00 AM to 2:30 PM. Second shift is 4 days, 10 hrs/day, 3:30 PM to 2:00 AM. There are two 1/2 hour lunch breaks (11:30-12:AM and 7:00-7:30 PM) and one hour between shifts (2:30-3:30 PM), but I thought that would really be a killer to add. Sometimes we work one shift on Saturdays, sometimes we shut down for a week. Holiday schedules get weird.

Date Start Stop Filter changed
3/08/02; 6:00 AM; 2:30 PM; 12:50 PM
3/09/02; 6:00 AM; 12:30 PM; None
3/10/02;;; No Production
3/11/02; 6:00 AM; 2:00 AM; 6:00 AM
3/12/02; 6:00 AM; 2:00 AM; 1:00 AM
3/13/02; 6:00 AM; 2:00 AM; 4:00 PM
3/14/02; 6:00 AM; 2:00 AM; None
3/15/02; 6:00 AM; 2:30 PM; 11:00 AM
3/16/02;;; No Production
3/16/02;;; No Production
3/17/02; 6:00 AM; 2:00 AM; 1:00 AM
Username is offline   Reply With Quote
Old Mar 21st, 2002, 03:58 PM   #5
Mark W.
MrExcel MVP
 
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
Default

Suppose your data (as shown above) is in A1:D12. The formula to calculate cumulative "Post Maintenance Production Hrs" could be entered into E2 as...

=IF(ISNUMBER(D2),C2-D2+(C2A2+(D2<0.25)+D2)/24,N(E1)+C2-B2+(C2
...and copied down to E12. Format column E as...

[h]:mm

This is such an elegantly designed sample data set I'm guessing it's literally a "text book" example; therefore, I'll let you do some of the [home] work and figure out how to factor in lunch hours. At least this should get you started!

Some documentation...

1. ISNUMBER(D2) is TRUE if filter was changed
2. C2-D2+(C2 3. -(C2="2:00"+0)*(A2+"2:30 P">A2+(D2<0.25)+D3)/24 deducts 1 hour if filter was changed before 1 hour inter-shift "break"
4. N(E1)+C2-B2+(C2 5. -(D2="None")*(C2="2:00"+0)*(C2<0.5)/24 deducts 1 hour if inter-shift "break" occurred on a day when a filter wasn't changed

[ This Message was edited by: Mark W. on 2002-03-22 06:33 ]
Mark W. is offline   Reply With Quote
Old Mar 21st, 2002, 05:25 PM   #6
Dave Patton
Board Regular
 
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
Default


consider in maint col

=IF(D7>0,(D7-B7+(B7>D7))+G6,"")

Carry fwd column G

=IF(D7>0,(C7-D7+(D7>C7)),(C7-B7+(B7>C7))+G6)

ensure you use custom format [h:]mm
Dave Patton is offline   Reply With Quote
Reply

Bookmarks

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 On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:19 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes