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 Jan 30th, 2009, 04:14 PM   #1
mgirvin
 
Join Date: Dec 2005
Location: Seattle, WA
Posts: 321
Default Round To 5 Minute Mark

Dear World’s Smartest Excel Team,

I have this formula for rounding up to the five minute mark:

=CEILING(A2,0.00347222222222224)

Where A2 has a time.

Question 1: Is my use of the decimal the best way to do this (best means accurate result and/or shortest formula)?


Also, what formula could I use to apply the standard rounding rule (select digit you want to round to, if the digit to the right it is 5 or more add 1, if the digit to the right it is less than 5 leave as is; standard ROUND function rule) so that I could round to the 5 minute mark?

For example:

2:02:30 PM would become 2:05:00 PM
2:02:29 PM would become 2:00:00 PM

Any ideas?
__________________
Sincerely, Mike Gel Girvin
mgirvin is offline   Reply With Quote
Old Jan 30th, 2009, 04:28 PM   #2
Jon von der Heyden
 
Jon von der Heyden's Avatar
 
Join Date: Sep 2004
Location: Hampshire, England
Posts: 4,023
Default Re: Round To 5 Minute Mark

Hello

Q1:
=CEILING(A2,"00:05")


Q2:
=ROUND(B1/"00:05",0)*"00:05"
__________________
Regards


Jon (XP Pro v.2002, XL2003)
Jon von der Heyden is online now   Reply With Quote
Old Jan 30th, 2009, 04:29 PM   #3
steimel386
 
Join Date: Jan 2009
Location: Muscatine, Iowa, USA
Posts: 33
Default Re: Round To 5 Minute Mark

Hey,

Keep in mind there is also ROUNDDOWN and ROUNDUP for those more specific instances.
steimel386 is offline   Reply With Quote
Old Jan 30th, 2009, 07:12 PM   #4
mgirvin
 
Join Date: Dec 2005
Location: Seattle, WA
Posts: 321
Default Re: Round To 5 Minute Mark

Dear Jon von der Heyden,

That is so clever. I can hardy believe it:

1) Ask how many 5 minute chunks there are, 2) Round to the integer, 3) Then multiply by five minutes!!

Did you make that up, or did you see it somewhere?

Thanks a lot, Jon von der Heyden!
__________________
Sincerely, Mike Gel Girvin
mgirvin is offline   Reply With Quote
Old Jan 30th, 2009, 10:12 PM   #5
Jon von der Heyden
 
Jon von der Heyden's Avatar
 
Join Date: Sep 2004
Location: Hampshire, England
Posts: 4,023
Default Re: Round To 5 Minute Mark

Quote:
Originally Posted by mgirvin View Post
Did you make that up, or did you see it somewhere?
I think I first saw this in a post by Barry Houdini. This question appears quite frequently, only usually to round to nearest 0.5.

You're welcome!
__________________
Regards


Jon (XP Pro v.2002, XL2003)
Jon von der Heyden is online now   Reply With Quote
Old Jan 30th, 2009, 10:22 PM   #6
mgirvin
 
Join Date: Dec 2005
Location: Seattle, WA
Posts: 321
Default Re: Round To 5 Minute Mark

It all starts with Aladin and Houdini, I guess.

We are lucky to be part of an amazing Excel Team!!!

Thanks again!
__________________
Sincerely, Mike Gel Girvin
mgirvin is offline   Reply With Quote
Old Jan 30th, 2009, 10:33 PM   #7
barry houdini
MrExcel MVP
 
Join Date: Mar 2005
Location: England
Posts: 14,298
Default Re: Round To 5 Minute Mark

Quote:
Originally Posted by mgirvin View Post
It all starts with Aladin and Houdini, I guess.
Well, I've used it but I didn't start it........

Another option to round to the nearest 5 minutes would be MROUND, but you need Analysis ToolPak add-in in Excel versions 2003 and earlier, i.e.

=MROUND(A1,"0:05")
barry houdini is online now   Reply With Quote
Old Jan 31st, 2009, 01:34 AM   #8
mgirvin
 
Join Date: Dec 2005
Location: Seattle, WA
Posts: 321
Default Re: Round To 5 Minute Mark

Dear Houdini,

Another great trick! I like MROUND becasue it completes the group: CEILING, FLOOR, MROUND. Just as ROUNDUP, ROUNDDOWN, ROUND are a group.

Thanks for helping to Lead the Team, Houdini!
__________________
Sincerely, Mike Gel Girvin
mgirvin 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 +1. The time now is 03:59 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 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