![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
In my workbook, column I contains a formula that returns a date based on the manually entered date in column H (though that is irrelevant to the formula I need). Column K also contains a manually entered date.
I need a formula for column Q that will: 1. See if there is a date in I and/or K. 2. If no date appears in either, return a blank in that row. 3. If there is a date in column K, return that date to column Q plus 12 months. 4. If there is no date in column K, but there is a date in column I, return that date to column Q plus 12 months. I've tried several formulas, each time I am either able to get the dates to calculate correctly but end up with a #VALUE error in column Q when the column I cell is "blank" because it's reading the formula there, or I don't get the error, but the formula seems to be ignoring the date in column I so that if there is no date in column K, it returns a blank. Here's what I've tried so far. =IF(AND(ISNUMBER($I2), ISNUMBER($K2)), IF($K2<>"", $K2+365, IF($I2<>"", $I2+365, "")), "") Returns date in column K, with no error on empty rows, but if I delete the number in column K, it ignores column I and returns a blank. =IF(AND(ISNUMBER($I2), ISNUMBER($K2)), IF($K2<>"", $K2+365, $I2+365), IFERROR(1/0, "")) Same as above. =IF(AND($K2="", $I2=""), "", IF($K2<>"", DATE(YEAR($K2)+1, MONTH($K2), DAY($K2)), DATE(YEAR($I2)+1, MONTH($I2), DAY($I2)))) Handles the dates correctly but returns #VALUE error in rows with no input. I also tried =IF(ISBLANK($K2),IF(ISBLANK($I2),"",EDATE($I2,12)) ,EDATE($K2,12)) Same results as the previous. Maybe the answer lies in somehow combining the two, but I don't know how. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error handling input to a Date variable | CuriousG | Excel Programming | 2 | 04-05-2022 08:51 AM |
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge | Berryblue | Mail Merge | 1 | 11-13-2014 05:36 PM |
![]() |
JUST ME | Word VBA | 4 | 03-25-2014 06:56 AM |
![]() |
tinfanide | Excel Programming | 2 | 06-10-2012 10:17 AM |
30+ days Variable Day Date Calculations via Fields | ztag | Word | 2 | 01-06-2012 11:12 AM |