Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 12th, 2006, 07:26 PM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help with time formulas

I am looking for a formula that will do the fallowing.

Look at cell E2 and E3 if there is a value in both cells then calculate the time and display it in cell G2. If there is only one value then calculate the time difference between cell E2 and F3 and display the result in cell G3.

A B C D E F G
1 DATE N# DAYS OFF ON DUTY OFF DUTY TOTAL DUTY
2 20:00
3 5:00 9
4 15:00 20:00 5
5
6
7
8
9

Can same one help me.
 
Old February 12th, 2006, 07:41 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I'm thinking something like...

in G3

=IF (E3='', F3-E3, IF (F3='', '', F3-E3))

That may need some tweaking but I think it should work if you then drag it into all other cells in G.

Mike

Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
IIF Formulas used in Update queries kypros79 Access 5 April 12th, 2018 09:06 PM
Formulas Juan0214 Access 4 July 2nd, 2008 02:04 PM
Formulas Change When Macro Runs maaron Excel VBA 2 June 20th, 2005 05:09 AM
Inputbox and Formulas bahachin Excel VBA 3 February 17th, 2005 01:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.