Sun and Moon states

Spindoctor

New Member
Joined
May 19, 2009
Messages
3
Hi

As you can see I'm a first time poster. I have spent the last 48 hours trying to find help on the below, suceeded in getting some way to the formula but seem to be falling at the last post! I have checked the forum, but can't find anything similar on which to compare.

To give you some background: I'm undertaking a 100km charity walk in a few weeks. Along the way we have checkpoints where we can change kit, refuel etc. In order to work out where we'd be at approximate times i've put together a spreadsheet that totals times based on average speed etc. All that seems to be working fine.

The bit I'm having a challenge with is as follows:

We'll be walking through the night and into the morning. I want to know roughly which stages we'll be walking in the dark. I have placed the time for sunrise in one cell and sunset in another.

In can make the formula work to an extent, but I can't work out how to make it revert back to the 'sun' state after sunrise!
The formula at present is: =IF(G8<=$C$4,"SUN","MOON")

G8 is the time of day we'll be at each checkpoint (formatted hh:mm am/pm)
$c$4 is sunset
$c$5 is sunrise

I'm using Excel 2003. Can anyone provide some assitance?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Welcome to the Board.

Try:

=IF(AND(G8>=$C$5,G8<$C$4),"SUN","MOON")

Make sure your times don't include a date.
 
Upvote 0
I'm undertaking a 100km charity walk in a few weeks.

A friend of mine is doing a similar thing around the Leeds area.

Best of luck, hope it goes well for you :)

Dom
 
Upvote 0
Because your times include a date (from G16 onwards) you need:

=IF(AND(MOD(G8,1)>=$C$5,MOD(G8,1)<$C$4),"SUN","MOON")
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top