LOGO
General Discussion Undecided where to post - do it here.

Reply to Thread New Thread
Old 01-13-2012, 01:02 AM   #1
tussinelde

Join Date
Oct 2005
Posts
311
Senior Member
Default Excel IF...
I have a timecard spreadsheet that I need help with.

One of the cells on the card represents "week starting", cell N4, (for instance, this week that cell is Jan. 8, 2012). There is another cell that represents "week ending", cell N5, and is based off of the other cell. This is what is the 2nd cell has:

Code:
Code
IF($N$4=0,"",$N$4+6)

Now, how can I make it do this:

IF: N4's date is either Jan. 1, 2012 or a multiple of 7 days after that date: if today's date is Jan 1, Jan 8, Jan 15 etc...
THEN: change that cell to today's date


I want it to automatically update the week starting and week ending as the document is opened/used so I don't have to manually change the date.
tussinelde is offline


Old 01-13-2012, 02:39 AM   #2
Sydneyfonzi

Join Date
Oct 2005
Posts
652
Senior Member
Default
I suppose you could use the text() function to check if it's a Monday?

I'm struggling to create a mental image of what these cells are doing however.
Though I'm sure someone else will understand better than I have, is there a possibility for a screeny or example file?
Sydneyfonzi is offline


Old 01-13-2012, 02:56 AM   #3
Heliosprime

Join Date
Oct 2005
Posts
602
Senior Member
Default
[offtopic]I just about passed Excel doing my ECDL... never touched it since, thank christ.
Heliosprime is offline


Old 01-13-2012, 05:40 AM   #4
obHQNsY2

Join Date
Oct 2005
Posts
484
Senior Member
Default
This will do what you want but there may be a better way if I could see the spreadsheet. This is pretty efficient though and will auto update.

Code:
Code
=IF(MOD(TODAY()-N4,7)=0,TODAY(),"Whatever you want this to be if it isn't a 7 day multiple")

obHQNsY2 is offline


Old 01-13-2012, 06:40 AM   #5
mXr8icOB

Join Date
Oct 2005
Posts
472
Senior Member
Default
This will do what you want but there may be a better way if I could see the spreadsheet. This is pretty efficient though and will auto update.

Code:
Code
=IF(MOD(TODAY()-N4,7)=0,TODAY(),"Whatever you want this to be if it isn't a 7 day multiple")
I think you need to wrap it in another IF to check if the date is 1st January 2012 as well...?
mXr8icOB is offline


Old 01-13-2012, 06:55 AM   #6
Rjvpicux

Join Date
Oct 2005
Posts
467
Senior Member
Default
Probably, this just does 7 day cycles from whatever first date is referenced. I don't know what he's trying to do with the rest of it.
Rjvpicux is offline


Old 01-13-2012, 07:05 AM   #7
flnastyax

Join Date
Oct 2005
Posts
454
Senior Member
Default
I'm not sure if Excel supports this syntax, but you need something like:

IF(MOD(TODAY()-N4,7)=0 OR TODAY() = '1 jan 2012',TODAY()
flnastyax is offline


Old 01-13-2012, 07:28 AM   #8
Viyzarei

Join Date
Oct 2005
Posts
404
Senior Member
Default
I'm not sure if Excel supports this syntax, but you need something like:

IF(MOD(TODAY()-N4,7)=0 OR TODAY() = '1 jan 2012',TODAY()
This should encapsulate it (I wrote it in the reply rather than in a spreadsheet so there might not be enough brackets) if it's required.
Code:
Code
=IF(OR(DATE(2012,1,1)=TODAY(),MOD(TODAY()-N4,7)=0),TODAY(),"Whatever you want this to be if it isn't a 7 day multiple")

Viyzarei is offline



Reply to Thread New Thread

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

All times are GMT +1. The time now is 10:11 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 PL2
Design & Developed by Amodity.com
Copyright© Amodity