Formula To Identify If Cell Dates Occur Within 30 Days of Adjacent Cell Date

eagerexceler

New Member
Joined
Jan 10, 2017
Messages
36
Office Version
  1. 2016
Platform
  1. Windows
Hello y'all,

I've got a simple formula to identify if a date in W4 occurs within 30 days of a date within X4: =IF(W4+30>X4,"Readmission Present", "No Readmission").

I'm trying to expand the formula to have it include this date comparison for the next 24 rows. As in, also including IF(X4+30>Y4.... and so on, all the way to AU4. I know I can do this with a crazy nested formula, but I'm wondering if anyone has any insight into making this a simpler formula.

Thank you!
 
Hi Fluff, I have tried your suggestion but I can't seem to get it to work properly. I'll be playing with it more when I get more availability. Thank you.
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I've changed a couple of the dates to show the result
+Fluff 1.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAW
1
2                         
312345678910111213141516171819202122232425330
4##-1Provider #2#BegEndIndCalcNameTot1Tot2ActAmtCatSLReCHExCY19MarProAd 1Ad 2Ad 3Ad 4Ad 5Ad 6Ad 7Ad 8Ad 9Ad 10Ad 11Ad 12Ad 13Ad 14Ad 15Ad 16Ad 17Ad 18Ad 19Ad 20Ad 21Ad 22Ad 23Ad 24Ad 25W/In 30?W/In 3?
511-111101/01/201904/01/2019I32xxxxxxxxxxxxxxxxxxxxx(blank)0018089.421ba01/01/2019                        Not PresentNot Present
622-112201/01/201904/01/2019I391xxxxxxxxxxxxxxxxxxxxx(blank)0011151.211ba01/01/2019                        Not PresentNot Present
733-113303/01/201915/02/2019I1xxxxxxxxxxxxxxxxxxxxx(blank)00351119.21ba03/01/2019                        Not PresentNot Present
844-114404/01/201911/01/2019I558xxxxxxxxxxxxxxxxxxxxx(blank)0061251ba04/01/2019                        Not PresentNot Present
955-117511/01/201925/01/2019I668xxxxxxxxxxxxxxxxxxxxx(blank)0013378.381ba11/01/201912/01/201920/12/2019                      PresentPresent
1055-215531/05/201907/06/2019I653xxxxxxxxxxxxxxxxxxxxx(blank)0037537.641ba11/01/201931/05/201928/06/2019                      Not PresentPresent
1155-316520/12/201923/12/2019I280xxxxxxxxxxxxxxxxxxxxx(blank)0011252.471ba11/01/201931/05/201920/12/2019                      Not PresentNot Present
Main
Cell Formulas
RangeFormula
W11:AU11,W10:X10,Y5:Y9,W5:W9,X5:X8,Z5:AU10,W2:AU2W2=IFNA(IF($H2="I",VLOOKUP($A2&"-"&W$3,$B:$F,5,FALSE),""),"")
X3:AU3X3=W3+1
A5:A11A5=E5
B5:B11B5=IF($H5="I",$E5&"-"&COUNTIFS($E$5:$E5,$E5,$H$5:$H5,"I"),"OP")
AV5:AW11AV5=IF(SUMPRODUCT(--(IFERROR(($W5:$AT5+AV$3)>$X5:$AU5,0))),"Present","Not Present")
 
Upvote 0
Solution
Thanks Oddball, I appreciate your details in looking at this! I'm definitely still a beginner, so I'm getting to learn more here.

1. So the problem I'm running into with the crazy nested formula is that the formula isn't working after the comparison of column Z903 to column AA903 in a particular example that should work. Is this because there isn't anything populated in cell AA903? What could I use to fix this? Sorry, I didn't initially include this example in my dummy worksheet.

2. I like that this simplifies things, but I ultimately need to compare these dates using two date amounts (3 vs 30), so wouldn't this require me to add a bunch more columns?

3. I'm not quite able to do much VBA yet, so this might be too much of a headache for me right now.

Again, thank you for your help!!
I agree with Fluff, try his single formula first, using it both in the 3 and 30 columns (may need to tweak so it's looking at the 3 and 30 correctly). If that wasn't an option for whatever reason, then yes you could splinter out another section for 30 and hide all those extra columns so they're not an eyesore on your sheet, just keeping the final tally columns viewable. He's formula appears to work though, I tried it on my end.
 
Upvote 0
Hey y'all, I got this formula working thanks to your help.

I have another formula in this spreadsheet that I can't crack, wondering if y'all can provide more help. Let me know if I need to start a new thread.

So in my spreadsheet each row represents a unique account number in column D, with a unique amount in column S. If a particular account is labeled as "Present" in, for example AV9, I need to have the corresponding amount from S9 populate in AX9. The end goal is to have accounts with the "Present" designation tally an amount per row that can then by Pivoted in a table. My attempts have been to do an index match type of nested formula, but I can't come up with it.

Hope I explained well. Thanks.
 
Upvote 0
Y'all are killing it for me! Good lessen for me to not always overthink things.

Very much appreciated.
 
Upvote 0
Ok guys, I hope you don't hate me for this, but I have another formula I'm hoping to come up with.

I added three columns to identify similar information. However, in columns AY and AZ I only need to identify if the common identifier in column A has any unique account numbers from column D that occur within 3 or 30 days of the date in column F. So this formula would be similar, but really only comparing dates for the common identifier in column A and the corresponding date in column F to identify "Oth Present" or "Oth Not Present". I can then use the formula you already came up with to get my result for column BA.

I'm sorry for throwing more at y'all!

Excel Nest If Date Within Another Date Example.xlsm
AYAZBA
3303
4Oth W/In 30?Oth W/In 3?Oth Exp
5
6
7
8
9
10
11
Sheet2
 
Upvote 0
Ok guys, I hope you don't hate me for this, but I have another formula I'm hoping to come up with.

I added three columns to identify similar information. However, in columns AY and AZ I only need to identify if the common identifier in column A has any unique account numbers from column D that occur within 3 or 30 days of the date in column F. So this formula would be similar, but really only comparing dates for the common identifier in column A and the corresponding date in column F to identify "Oth Present" or "Oth Not Present". I can then use the formula you already came up with to get my result for column BA.

I'm sorry for throwing more at y'all!

Excel Nest If Date Within Another Date Example.xlsm
AYAZBA
3303
4Oth W/In 30?Oth W/In 3?Oth Exp
5
6
7
8
9
10
11
Sheet2
Though related to the original sheet, if it's unrelated to your original issue that appears solved, I think you need to post this as a new question? I'll keep an eye out for it once posted.

Did you mark Fluff's formula as solved above?
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top