Need Help Converting this Formula to Use CONCATENATE Instead of &

zach9208

Board Regular
Joined
Dec 15, 2015
Messages
117
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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Test to see if this produces a date:

=EOMONTH(CONCATENATE(LEFT(D8,3)," 1, ",RIGHT(D6,4)),0)
 
Upvote 0
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)),""))))
 
Upvote 0
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)),""))))
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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