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

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
Joined
Oct 20, 2009
Messages
8,388
Office Version
  1. 365
Platform
  1. Windows
Test to see if this produces a date:

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

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,696
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
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
Joined
Dec 15, 2015
Messages
117
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)),""))))
 

Watch MrExcel Video

Forum statistics

Threads
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.
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
Top