WORKDAY formula round up (perhaps arrays)

Domyzon

New Member
Joined
Dec 30, 2016
Messages
19
Hello!

I have a problem I am trying to solve.

Problem 1.

1. I have daily dates from 01.01.2017 - 31.12.2017 -> cells B1:NB1
2. I have a cost of 100€ that I have to pay every month, on the 15th, nearest to the WORKDAY.

Anyone knows what formula to use in order to insert it in B2 (just below the first date) and drag it until the end of the year so 100€ would be filled under appropriate dates?
For example, 15.01.2017 is a Sunday, so 100€ would go under 16.01.2017 as it is the closest workday.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
For example, 15.01.2017 is a Sunday, so 100€ would go under 16.01.2017 as it is the closest workday.
Does that mean if the 15th occurs on a Saturday, the Friday before is marked?

Do we have to take holidays into account? If so, where is your list of dates for the holidays located at?
 
Upvote 0
Try this:

=IF(AND(DAY(B1)=15,WEEKDAY(B1,2)<6),100,IF(AND(DAY(B1)=14,WEEKDAY(B1,2)=5),100,IF(AND(DAY(B1)=16,WEEKDAY(B1,2)=1),100,"")))
 
Upvote 0
Thanks, almost! It doesn't seem to work if the date is on Sunday...

I used 15-1 and 15+1 for 14 and 16, as if 15 was changing variable, determined in another cell.
 
Last edited:
Upvote 0
Put this formula in cell B2 and copy it across to cell NB2...

=IF(DAY(B1)=15-(WEEKDAY(DATE(YEAR(B1),MONTH(B1),15))=7)+(WEEKDAY(DATE(YEAR(B1),MONTH(B1),15))=1),"100€","")
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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