if day of month is greater than 15, increment month by 1 in text format

Wishmaster89

Board Regular
Joined
Jan 10, 2022
Messages
77
Office Version
  1. 2021
  2. 2019
  3. 2016
Platform
  1. Windows
  2. MacOS
Hi All

I've got a formula where im trying to increment the month by 1 if the day is >15. The EDATE part works fine on its own but when i add in the text formatting it gives the error of #NAME?

Book1
AB
1Start DateOnboard date
2
318/02/2023#NAME?
Sheet1
Cell Formulas
RangeFormula
B3B3=IF(DAY(A3)>15,TEXT(EDATE(I12,1),mmm-yy),TEXT(A3,"mmm-yy"))
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi, your missing the double quotes around this part mmm-yy of the first TEXT() function.
 
Upvote 0
Thank you @FormR that worked :),

Just realised i referenced the wrong cell in the edate function aswell doh!
 
Upvote 0
Just FYI, you can shorten that a bit to:

Excel Formula:
=TEXT(EDATE(A3,N(DAY(A3)>15)),"mmm-yy")

DAY(A3)>15 will return True/False as applicable. N() will convert that to 1 or 0 respectively, so it only adds a month if the day is >15.
 
Upvote 0
an alternative to post #1

Date and Time 2021.xlsm
ABC
1Start DateOnboard dateOnboard date 2
218-Feb-23Mar-23Mar-23
312-Feb-23Feb-23Feb-23
4
13d
Cell Formulas
RangeFormula
B2:B3B2=IF(DAY(A2)>15,TEXT(EDATE(A2,1),"mmm-yy"),TEXT(A2,"mmm-yy"))
C2:C3C2=TEXT(EDATE(A2,0+(DAY(A2)>15)),"mmm-yy")
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,487
Members
448,967
Latest member
visheshkotha

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