# Need Help Converting this Formula to Use CONCATENATE Instead of &

#### zach9208

##### Board Regular
I am stuck trying to convert this dynamic formula to use the CONCATENATE function instead of the &s. I am using an Excel add-in that does not accept "&" in formulas. I have tried several times to do this myself but cannot figure out what I am doing wrong. It doesn't seem to play nicely with the EOMONTH Function. This formula is used to show the number of days within each period whether it be monthly, quarterly or yearly.

=IF(AND(D7="MONTHLY",ISNUMBER(SEARCH("FORECAST",D6))),DAYS(EOMONTH(LEFT(D8,3)&" 1, "&RIGHT(D6,4),0),EOMONTH(LEFT(D8,3)&" 1, "&RIGHT(D6,4),-1)),IF(AND(D7="MONTHLY",ISNUMBER(SEARCH("ACTUAL",D6))),DAYS(EOMONTH(LEFT(D8,3)&" 1, "&LEFT(D6,4),0),EOMONTH(LEFT(D8,3)&" 1, "&LEFT(D6,4),-1)),IF(D7="Quarter",DAYS(EOMONTH(TEXT(DATE(RIGHT(D6,4),LEFT(D8,1)*3,1),"MMM")&" 1, "&RIGHT(D6,4),0),EOMONTH(TEXT(DATE(RIGHT(D6,4),LEFT(D8,1)*3,1),"MMM")&" 1, "&RIGHT(D6,4),-3)),IF(D7="Cumulated",DAYS(EOMONTH("Dec 31, "&RIGHT(D6,4),0),EOMONTH("Dec 31, "&RIGHT(D6,4),-12)),""))))

Here is a sample of the the text that these formulas are using.

Monthly column example
D6=Forecast 2018
D7=Monthly
D8= January

Quarterly column example
Q6= Forecast 2019
Q7= Quarter
Q8=1st Quarter

Yearly column example
V6=Forecast 2020
V7= Cumulated
V8 = December

Last edited:

### Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

#### steve the fish

##### Well-known Member
Test to see if this produces a date:

=EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",RIGHT(D6,4)),0)

#### RoryA

##### MrExcel MVP, Moderator
Try this:

=IF(AND(D7="MONTHLY",ISNUMBER(SEARCH("FORECAST",D6))), DAYS(EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",RIGHT(D6,4)),0),EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",RIGHT(D6,4)),-1)),IF(AND(D7="MONTHLY",ISNUMBER(SEARCH("ACTUAL",D6))),DAYS(EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",LEFT(D6,4)),0),EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",LEFT(D6,4)),-1)),IF(D7="Quarter",DAYS(EOMONTH(CONCATENATE(TEXT(DATE(RIGHT(D6,4),LEFT(D8,1)*3,1),"MMM")," 1, ",RIGHT(D6,4)),0),EOMONTH(CONCATENATE(TEXT(DATE(RIGHT(D6,4),LEFT(D8,1)*3,1),"MMM")," 1, ",RIGHT(D6,4)),-3)),IF(D7="Cumulated",DAYS(EOMONTH(CONCATENATE("Dec 31, ",RIGHT(D6,4)),0),EOMONTH(CONCATENATE("Dec 31, ",RIGHT(D6,4)),-12)),""))))

#### zach9208

##### Board Regular
Correct, this renders 43131, which converted to short date format is 01/31/2018.

Test to see if this produces a date:

=EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",RIGHT(D6,4)),0)

#### zach9208

##### Board Regular
Thanks, Rory! This seems to be exactly what I am looking for!!

Try this:

=IF(AND(D7="MONTHLY",ISNUMBER(SEARCH("FORECAST",D6))), DAYS(EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",RIGHT(D6,4)),0),EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",RIGHT(D6,4)),-1)),IF(AND(D7="MONTHLY",ISNUMBER(SEARCH("ACTUAL",D6))),DAYS(EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",LEFT(D6,4)),0),EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",LEFT(D6,4)),-1)),IF(D7="Quarter",DAYS(EOMONTH(CONCATENATE(TEXT(DATE(RIGHT(D6,4),LEFT(D8,1)*3,1),"MMM")," 1, ",RIGHT(D6,4)),0),EOMONTH(CONCATENATE(TEXT(DATE(RIGHT(D6,4),LEFT(D8,1)*3,1),"MMM")," 1, ",RIGHT(D6,4)),-3)),IF(D7="Cumulated",DAYS(EOMONTH(CONCATENATE("Dec 31, ",RIGHT(D6,4)),0),EOMONTH(CONCATENATE("Dec 31, ",RIGHT(D6,4)),-12)),""))))

Replies
4
Views
375
Replies
7
Views
124
Replies
0
Views
62
Replies
6
Views
182
Replies
3
Views
174

1,129,419
Messages
5,636,165
Members
416,903
Latest member
Sanjayaranj

### 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.

### Which adblocker are you using?

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

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