Extract month from text and include condition to get updated months

Bigbanana

New Member
Joined
Dec 28, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Dear All,

I have a file where I need to extract the month from Column Y's text, which I have used Column AC for that.
If the date in AC is on or before 15, the expected month of revenue = AC + 2 months. If false, = AC + 3 months. I have a Column AD for the results.
If Column Y does not contain any date, the results should appear as TBC.

This works fine, but I need 2 columns (AC and AD) for that.

I wish to combine it into a single column AC, but could not get the formula right.

Any help would be appreciated.

Thanks in advance.
 

Attachments

  • Excel Help.PNG
    Excel Help.PNG
    17.6 KB · Views: 15

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).
Is the date always on the right? If so, try:
like Eric, assuming any data is on the right,
Also, we have been guessing that if there is a date, it is at the right of the text. You haven't advised whether that is the case or not so we may be wasting our efforts?
Remember you are very familiar with your data but we only know what you show and tell us. ;)
 
Last edited:
Upvote 0
Also, we have been guessing that if there is a date, it is at the right of the text. You haven't advised whether that is the case or not so we may be wasting our efforts?
Remember you are very familiar with your data but we only know what you show and tell us. ;)
Sorry for missing it. If there is a date, it will be on the right of the text.
I do not have the "Let" formula in my Excel.
 
Upvote 0
I included most of the suggestions. My system has International Regional Settings dd-mmm-yy.
An additional alternative is Data Text to Columns.

T202012c.xlsm
ABCDEFGHI
1SubsituteAggregateLong withV() withText to
2Midwith V()with V() Peter_SSswith V() Eric WDateDateColumn
3AFS 2/3/20212-May-212-May-212-May-212-May-21May 2, 20212-May-21Mar 2, 2021May 2, 2021
4AFS 15/3/202115-May-2115-May-2115-May-2115-May-21May 15, 202115-May-21Mar 15, 2021May 15, 2021
5AFS 22/3/202122-Jun-2122-Jun-2122-Jun-2122-Jun-21Jun 22, 202122-Jun-21Mar 22, 2021Jun 22, 2021
6AFSTBCTBCTBCTBCTBCTBC
7Text to Columns
2d
Cell Formulas
RangeFormula
B3:B6B3=IFERROR(EDATE(--MID(A3,FIND(" ",A3)+1,31),2+(DAY(--MID(A3,FIND(" ",A3)+1,31))>15)),"TBC")
C3:C6C3=IFERROR(EDATE(V(--MID(A3,FIND(" ",A3)+1,31)),2+(DAY(V())>15)),"TBC")
D3:D6D3=IFERROR(EDATE(V(--TRIM(RIGHT(SUBSTITUTE(A3," ",REPT(" ",10)),10))),2+(DAY(V())>15)),"TBC")
E3:E6E3=IFERROR(EDATE(V(AGGREGATE(14,6,RIGHT(A3,{8,9,10})+0,1)),2+(DAY(V())>15)),"TBC")
F3:F6F3=IFERROR(EDATE(DATE(RIGHT(A3,4),MID(A3,LEN(A3)-5,1),MID(A3,LEN(A3)-8,2)),2+(DAY(DATE(RIGHT(A3,4),MID(A3,LEN(A3)-5,1),MID(A3,LEN(A3)-8,2)))>15)),"TBC")
G3:G6G3=IFERROR(EDATE(V(DATE(RIGHT(A3,4),MID(A3,LEN(A3)-5,1),MID(A3,LEN(A3)-8,2))),2+(DAY(V())>15)),"TBC")
I3:I5I3=EDATE(H3,2+(DAY(H3)>15))


Since you do not have LET, you could try a UDF called V(). It has been available for about 20 years.
It saves a Value; much like saving a constant or amount in memory with a calculator.

Public Function V(Optional vrnt As Variant) As Variant
Static vrntV As Variant
If Not IsMissing(vrnt) Then vrntV = vrnt
V = vrntV
End Function

Try the suggestions and advise advise which work for you.
 
Upvote 0
Solution
Guys, this worked massively well!

Thanks for the contribution, and I sure learned alot from this.

Take care!
 
Upvote 0
Assuming with Dave's data and post above, I would want to take it further by creating a simple Pivot to sum by Month. Understand that Pivots will be unable to Group by month if there are blanks or text in the columns. is there a way to overcome that? I really have some data that I want to indicate as "TBC" for example.
 
Upvote 0

Forum statistics

Threads
1,215,676
Messages
6,126,159
Members
449,295
Latest member
DSBerry

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