Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
rediproof
 
Posts: n/a
Default If formula for date range


I am trying to set up a formula to check milestones which fall between
15 days + or - of todays date using IF. If the result matches I want
the true value to be text in another cell.

I've come up with the formula to check if it matches today (see below)
but am having problems when trying to add in the +/- 15 days.

=IF(C17=B26,B17,0)

C17 is milestone date
B26 is todays date
B17 is milestone description

I also want to extend this to multiple cells.

Any help would be appreciated.


--
rediproof
------------------------------------------------------------------------
rediproof's Profile: http://www.excelforum.com/member.php...o&userid=23714
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #2   Report Post  
swatsp0p
 
Posts: n/a
Default


Use this formula in your desired output cell:

=IF(AND(C17<=B26+15,C17=B26-15),B17,"Beyond 15 days")

Dates within +/- 15 days of the date in B26 will return the value in
B17, dates earlier or later than 15 days from that date will return
"Beyond 15 days" -- you can edit this output to meet your needs

HTH

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #3   Report Post  
rediproof
 
Posts: n/a
Default


swatsp0p Wrote:
Use this formula in your desired output cell:

=IF(AND(C17<=B26+15,C17=B26-15),B17,"Beyond 15 days")

Dates within +/- 15 days of the date in B26 will return the value in
B17, dates earlier or later than 15 days from that date will return
"Beyond 15 days" -- you can edit this output to meet your needs

HTH

Bruce


Thanks Bruce!!!!


--
rediproof
------------------------------------------------------------------------
rediproof's Profile: http://www.excelforum.com/member.php...o&userid=23714
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #4   Report Post  
rediproof
 
Posts: n/a
Default


If I wanted to extend this formula to other cells on the same row such
as e&f how would this be done? I've tried the formula below but get a
#value error message

=IF(AND(C17<=$B$26+15,C17=$B$26-15),B17,0),IF(AND(F17<=$B$26+15,F17=$B$26-15),E17,0)


--
rediproof
------------------------------------------------------------------------
rediproof's Profile: http://www.excelforum.com/member.php...o&userid=23714
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #5   Report Post  
PokerZan
 
Posts: n/a
Default


Does taking the absolute ($) referece off of the string help?

Like this:

=IF(AND(C17<=B26+15,C17=B26-15),B17,0),IF(AND(F17<=B26+15,F17=B26-15),E17,0)


--
PokerZan
------------------------------------------------------------------------
PokerZan's Profile: http://www.excelforum.com/member.php...o&userid=23480
View this thread: http://www.excelforum.com/showthread...hreadid=374135



  #6   Report Post  
rediproof
 
Posts: n/a
Default


PokerZan Wrote:
Does taking the absolute ($) referece off of the string help?

Like this:

=IF(AND(C17<=B26+15,C17=B26-15),B17,0),IF(AND(F17<=B26+15,F17=B26-15),E17,0)


B26 is a cell that contains todays date so it should not cause a
problem. I've tried this formula and it does partly work however, for
the second set of cells it gives the false answer even when the data is
true and I don't know how to get a space to appear between the 2
values.

=IF(AND(C17<=$B$26+15,C17=$B$26-15),B17,0)&(IF(AND(F17<=$B$26+15,F17=$B$26-15),E17,0))


--
rediproof
------------------------------------------------------------------------
rediproof's Profile: http://www.excelforum.com/member.php...o&userid=23714
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #7   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Hi rediproof,

You want the whole result in one cell only, or are you talking about 2
such results. You can break up your formula into 2 cells as

=IF(AND(C17<=$B$26+15,C17=$B$26-15),B17,0)

=IF(AND(F17<=$B$26+15,F17=$B$26-15),E17,0)

If you want to check both conditions in one cell then you need to do
something like:

=IF(AND(C17<=$B$26+15,C17=$B$26-15),B17,0) & " " &
IF(AND(F17<=$B$26+15,F17=$B$26-15),E17,0)

This should come on one line only

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #8   Report Post  
mangesh_yadav
 
Posts: n/a
Default



I've tried this formula and it does partly work however, for the second
set of cells it gives the false answer even when the data is true


Also can you give your sample data for which you say that you don't get
your expected answer..

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #9   Report Post  
rediproof
 
Posts: n/a
Default


Thanks mangesh_yadav the formula worked perfectly


--
rediproof
------------------------------------------------------------------------
rediproof's Profile: http://www.excelforum.com/member.php...o&userid=23714
View this thread: http://www.excelforum.com/showthread...hreadid=374135

  #10   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Hi rediproof

Thanks for the feedback.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=374135

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formula to copy last positive number in range of cells rolan Excel Worksheet Functions 6 May 14th 05 02:27 PM
how do I make a formula NOT change when the data range is moved? Alida Andrews Excel Discussion (Misc queries) 2 January 6th 05 09:02 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
HOW TO USE A FORMULA TO CHANGE CELL COLOR ACCORDING TO DATE RANGE. terry Excel Worksheet Functions 2 December 27th 04 04:07 AM
How to populate formula in range of vertical cells to next colum Robert Excel Worksheet Functions 0 November 17th 04 05:09 AM


All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"