Fill in missing dates for weekends, holidays and source errors

DRSteele

Well-known Member
Joined
Mar 31, 2015
Messages
2,640
Office Version
  1. 365
Platform
  1. Windows
Can someone please help me?

I wish to fill in the missing data for cells where there is a weekend, a holiday or an NA error. I need a formula to get it done. Like this, where the blue stuff in columnO I filled in from the prior valid date by typing it:

Book1
MNOPQR
11DATA
12datevaluedesired1datedesired2
1312/23/2022$ 19,506.65$ 19,506.6512/23/2022$ 19,506.65
1412/27/2022#N/A$ 19,506.6512/24/2022$ 19,506.65
1512/28/2022$ 19,284.10$ 19,284.1012/25/2022$ 19,506.65
1612/29/2022$ 19,485.89$ 19,485.8912/26/2022$ 19,506.65
1712/30/2022$ 19,384.92$ 19,384.9212/27/2022$ 19,506.65
181/2/2023#N/A$ 19,384.9212/28/2022$ 19,284.10
191/3/2023#N/A$ 19,384.9212/29/2022$ 19,485.89
201/4/2023$ 19,588.83$ 19,588.8312/30/2022$ 19,384.92
211/5/2023$ 19,506.84$ 19,506.8412/31/2022$ 19,384.92
221/6/2023$ 19,814.51$ 19,814.511/1/2023$ 19,384.92
231/9/2023$ 19,857.07$ 19,857.071/2/2023$ 19,384.92
241/10/2023$ 19,898.86$ 19,898.861/3/2023$ 19,384.92
251/4/2023$ 19,588.83
261/5/2023$ 19,506.84
271/6/2023$ 19,814.51
281/7/2023$ 19,814.51
291/8/2023$ 19,814.51
301/9/2023$ 19,857.07
311/10/2023$ 19,898.86
321/11/2023$ 19,898.86
Sheet1
Cell Formulas
RangeFormula
N14,N18:N19N14=NA()
R13:R32R13=XLOOKUP(Q13,$M$13:$M$24,$O$13:$O$24,,-1)
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Try:

Book1
KLMNOPQR
11DATA
12Holidaysdatevaluedesired1datedesired2
132/2/202312/23/202219506.6519506.6512/23/202219506.65
1412/27/2022#N/A19506.6512/24/202219506.65
1512/28/202219284.1019284.1012/25/202219506.65
1612/29/202219485.8919485.8912/26/202219506.65
1712/30/202219384.9219384.9212/27/202219506.65
181/2/2023#N/A19384.9212/28/202219284.10
191/3/2023#N/A19384.9212/29/202219485.89
201/4/202319588.8319588.8312/30/202219384.92
211/5/202319506.8419506.8412/31/202219384.92
221/6/202319814.5119814.511/1/202319384.92
231/9/202319857.0719857.071/2/202319384.92
241/10/202319898.8619898.861/3/202319384.92
251/4/202319588.83
261/5/202319506.84
271/6/202319814.51
281/7/202319814.51
291/8/202319814.51
301/9/202319857.07
311/10/202319898.86
321/11/202319898.86
Sheet2
Cell Formulas
RangeFormula
N14,N18:N19N14=NA()
O13:O24O13=IF(WORKDAY(M13-1,1,$K$13:$K$15)=M13,IFERROR(N13,O12),O12)
R13:R32R13=XLOOKUP(Q13,$M$13:$M$24,$O$13:$O$24,,-1)
 
Upvote 0
Solution

Forum statistics

Threads
1,215,526
Messages
6,125,328
Members
449,218
Latest member
Excel Master

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