Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2011, 07:33 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Help with IF Statement Windows 7 32bit Help with IF Statement Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi Tim,



It would be easier to follow if you attached a sample worksheet to the thread but I think the problem is that you are only putting times in the cells (rather than dates and times).

Instead of putting 5:23:00 PM in a cell, put 01/03/2011 5:23:00PM. If all the cells are set up this way then you can easily subtract them from each other and periods which span across multiple dates will automatically be accounted for.

To deal with the Sunrise / Sunset issue, I suggest you keep a separate table which lists the sunrise and sunset times by date. You can then use a VLOOKUP() to retrieve the sunrise and sunset for the relevant date - since you would now be including the dates in the cells (not just the times) you can look up the correct sunrise/sunset dates without a problem.

Once you have this set-up your calculations will become much easier because all of the underlying numbers will be correct. Feel free to attach an example to the thread and I'll help you put some formulas in place to calculate the day/night hours for each record.
Reply With Quote
Reply

Tags
if statement



Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoice Statement Shoshana3 Word 0 11-15-2010 03:02 PM
Help with IF Statement if statement piper7971 PowerPoint 1 08-19-2010 07:10 AM
Help with IF Statement Help with IF statement! CPelkey Word 1 04-12-2010 09:06 AM
Have you seen this error statement? nebb Word 4 12-01-2009 10:05 AM
Help with IF Statement Vlookup and If statement problem bunnygum Excel 1 03-24-2009 05:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft