Display month based on calculations

Hawkeyes26

New Member
Joined
Aug 30, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I need a formula that will display “if a selected date +21 days is at least 30 days from the 1st of the next month, then display the next month. If less than 30 days from the first of the next month, then display the next month + 1 month.”

For example, if a selected date is 9/11, then 21 days from that date would be 10/1. Since this is 30 days from the next month, 11/1, then I need to display 11/1.

If a selected date is 9/17, then 21 days from that date would be 10/7. Since 10/7 is less than 30 days from the next month, 11/1, I need to display 12/1:
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
try this:

Mr excel questions 58.xlsm
ABCDEF
1
2
3Selected Date21 Days DateDays to Next MonthDesired ResultFORMULA
42023-09-112023-10-02302023-11-012023-11-01
52023-09-172023-10-08242023-12-012023-12-01
Hawkeyes26
Cell Formulas
RangeFormula
C4:C5C4=B4+21
D4:D5D4=EOMONTH(C4,0)+1-C4
F4:F5F4=IF(EOMONTH(B4+21,0)+1-(B4+21)<30,EOMONTH(B4+21,1)+1,EOMONTH(B4+21,0)+1)
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

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