Computing.Net > Forums > Office Software > Help Creating an Excel IF Statement

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.

Help Creating an Excel IF Statement

Reply to Message Icon

Name: rickstyles
Date: February 7, 2008 at 07:01:39 Pacific
OS: Win XP Home
CPU/Ram: 2.2Ghz 512MB
Product: AMD Athlon
Comment:

I have a date in cell (f7) and want to add 30 days onto it in cell (i7) but, if the date in cell (i7) turns out to be greater than Oct 15 I want to subtract the amount of days more than Oct 15 it is and add that amount to May 15. Can anyone help?



Sponsored Link
Ads by Google

Response Number 1
Name: Bryco
Date: February 7, 2008 at 08:10:32 Pacific
Reply:

So, let's say your date in cell (i7) is Oct 17 then you want to subtract two days and add it to May 15 making May 17?

Where would May 17 appear; in (i7)?

Bryan


0

Response Number 2
Name: rickstyles
Date: February 7, 2008 at 08:50:07 Pacific
Reply:

Yes, I would like the May 17 to appear in cell (i7).


0

Response Number 3
Name: DerbyDad03
Date: February 7, 2008 at 09:45:31 Pacific
Reply:

I think this works. Let me know...

I put September 17, 2008 in F7 and got May 17, 2008 in I7.

I put October 17, 2008 in F7 and got June 16, 2008 in I7.

=IF(F7+30>DATEVALUE("10/15/2008"),DATEVALUE("5/15/2008")+((F7+30)-DATEVALUE("10/15/2008")),F7+30)


0

Response Number 4
Name: DerbyDad03
Date: February 7, 2008 at 10:02:05 Pacific
Reply:

Hmmm...just realized that you didn't say anything about what year (or years) we are talking about, so my formula is hardcoded for 2008 dates. This should work for every year, and assumes the May 15 we are talking about is in the year after the Oct 15.

=IF(F7+30>DATEVALUE("10/15/"&YEAR(NOW())),DATEVALUE("5/15/"&YEAR(NOW())+1)+(F7+30)-DATEVALUE("10/15/"&YEAR(NOW())),F7+30)



0

Response Number 5
Name: rickstyles
Date: February 7, 2008 at 10:43:34 Pacific
Reply:

Okay, I put Oct 2, 2005 into cell (F7) and copied your second statement into cell (I7) and got Nov 1, 2005. When I put Oct 2, 2008 into cell (F7) I get June 1, 2009 in cell (I7) so I don't think the second statement works for all years.

Also, I added some more information into the spreadsheet and copied the statement into another cell (L7), changed the references to from cell (F7 to I7) and ended up with Jan 29, 2010 in cell (L7).


0

Related Posts

See More



Response Number 6
Name: Bryco
Date: February 7, 2008 at 10:54:54 Pacific
Reply:

DerbyDad03,

I was hoping you would chime in after getting clarification on which cell was the target cell.

Thanks and regards,
Bryan


0

Response Number 7
Name: DerbyDad03
Date: February 7, 2008 at 11:26:43 Pacific
Reply:

Well, when I said "every year" I meant "starting now and going forward". I didn't realize you were living in the past. <g>

How *do* you want it to work? Will you be working with previous years (e.g. 2005)? If so, what May 15 are we basing the results on? May 15 of the same year or the next year or ...?


0

Response Number 8
Name: rickstyles
Date: February 7, 2008 at 12:24:38 Pacific
Reply:

I am sorry for being vague. I am working with previous years (2005, 2006, 2007). The May 15 would be the following year (eg. Oct 15, 2005 and May 15, 2006.)


0

Response Number 9
Name: DerbyDad03
Date: February 7, 2008 at 12:39:15 Pacific
Reply:

No need to apologize...if you didn't know that the years you planned on using mattered in the make up of the formula, then you wouldn't have known to tell us about them.

How about this...

This version uses the year of the value in F7 to determine what year to use in the DATEVALUE functions.

=IF(F7+30>DATEVALUE("10/15/"&YEAR(F7)),DATEVALUE("5/15/"&YEAR(F7)+1)+(F7+30)-DATEVALUE("10/15/"&YEAR(F7)),F7+30)

If this works for you, then I should of thought of using the year of the original date in the first place. See what happens when I rush things? <g>


0

Response Number 10
Name: rickstyles
Date: February 7, 2008 at 13:10:46 Pacific
Reply:

I appreciate the help very much. The statement works for all of the years that I need it to. Thanks again!


0

Sponsored Link
Ads by Google
Reply to Message Icon






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: Help Creating an Excel IF Statement

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

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

Help Creating an Excel IF Statement www.computing.net/answers/office/help-creating-an-excel-if-statement/8530.html