Computing.Net > Forums > Office Software > Excel IF Statement question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Excel IF Statement question

Reply to Message Icon

Name: gillywilly
Date: September 12, 2007 at 12:39:15 Pacific
OS: Windows XP
CPU/Ram: un known
Product: Acer
Comment:

i have several start and end times and want to work out what meals people are elligible for dependend on the hours they work i thought an IF/AND/OR statement would be good.
If they work 0200 - 0830 they can claim breakfast
if they work 1130 - 1430 they can claim lunch
if they work 1830 - 2130 they can claim dinner
if they work 2130 - 0200 they can claim a snack
can anyone help?



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: September 12, 2007 at 15:31:01 Pacific
Reply:

You didn't tell us how the hours are on listed on the spreadsheet, so it's a bit difficult to come up with a solution. We really need more info.

Taking a guess that the start time is in a given cell, say, A1, this might work:

=(IF(A1=TIMEVALUE("21:30"),"Snack",IF(A1=TIMEVALUE("18:30"),"Dinner",IF(A1=TIMEVALUE("11:30"),"Lunch",IF(A1=TIMEVALUE("2:00"),"Breakfast","Please Enter A Valid Start Time")))))

I can also see the use of VLOOKUP, HLOOKUP)MATCH, and a host of other functions depending on how the spreadsheet is laid out.


0

Response Number 2
Name: gillywilly
Date: September 17, 2007 at 12:20:07 Pacific
Reply:

Basically i want to work out when people can claim for what underneath the breakfast, lunch, dinner, snack column. I thought an IF AND/OR statement would be best but then maybe a VLOOKUP would be better to lookup on another sheet?

They can claim for breakfast if they work anytime between 0200 - 0900 (even if they start at 0800 for example)
They can claim for lunch between 1130-1430
Dinner between 1800-2130
Snack between 2130-0200

There are several 'start' and 'end' times across the spreadsheet and i need to be able to evaluate each one to see if in any of them there are any time that match above. let's say the first start time is in B2 and first end time is in C2 i need to see if anyone started work between 0200 & 0900, if they did they can claim for breakfast (even if they started at 0800) but I also need to see if the same cells if they worked between the lunch hours, dinner hours etc as different people will be working at different times.

Hope that makes a little more sense. I do have an attachment but can't see anywhere on this site to be able to attach it?

Hope that helps to paint the picture a little.

Thank you!


0

Response Number 3
Name: DerbyDad03
Date: September 17, 2007 at 12:35:36 Pacific
Reply:

You can't attach anything in this forum.

I've PM'd an e-mail address that you can send the sheet to if you want me to look at it.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Mail Merge / Macro to Pro... powerpoint stopped workin...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Excel IF Statement question

Microsoft Excel IF Statement www.computing.net/answers/office/microsoft-excel-if-statement/4444.html

Excel IF Statement Help Needed www.computing.net/answers/office/excel-if-statement-help-needed/7417.html

Excel IF statements and conditional www.computing.net/answers/office/excel-if-statements-and-conditional/7035.html