Formula working in 2019 not in 2007

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello experts,
I have this Eric W's formula which is working in excel 2019 but showing an error in 2007. Can someone please tell me what can be the solution.?
Book1.xlsx
ABCDEF
117/08/2021aaz/116820829672/a2V/yzavz#NAME?
2zzzyz555@ayazz/yzyazazzz 
317/08/2021aaz/116820329131/a2V/azzyz#NAME?
4aw16889- 
51@ayzxza/azzyzaW 
617/08/2021yzza_zy:yyzyz2116881584#NAME?
73/0031/ yzazaz zyazazaa 
816/08/2021yzza_aaa:aayzz21167213#NAME?
9021/azyzy 
10zyyavzazaya/yyzy0001435/04 
1113090674 
1216/08/2021zyaa-#NAME?
13zy/116713428622/924626717 
141/yzazzazy 
15
16Solved by Eric W
17
18insert column next to description
19select description column and align text to left
20remove extra spaces by replace 2 spaces with 1 space
21Enter formula in Narration Heading row cell E1
22=IF(C1="","",_xlfn.CONCAT(D1:INDEX(D:D,IFERROR(AGGREGATE(15,6,ROW(C1:C9)/(C2:C10<>""),1),ROW()+10))))
23range not required to change
Concat rows at each date
Cell Formulas
RangeFormula
E1:E14E1=IF(C1="","",_xlfn.CONCAT(D1:INDEX(D:D,IFERROR(_xlfn.AGGREGATE(15,6,ROW(C1:C9)/(C2:C10<>""),1),ROW()+10))))
 
Of course, I added one extra requirement to insert a space in between the data of each row concatenated. That you have solved too.
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You still have to install the code. But there's 2 ways you can use code. One is a sub like JohnnyL showed, it's a procedure that runs when you kick it off. The second way is by using a UDF (User Defined Function). This means you can create your own functions, that you call the same way on the worksheet. That's what I did. Depending on how your spreadsheet works, how you enter the data, etc., you might choose one or the other. This should work fine in 2007.
Oh. I thought the formula will work in 2007 without the code.😉
 
Upvote 0
I have saved both the codes in my code bank. You never know when I will need like the one Jasonb75's formula came in handy today after 2 years.
 
Upvote 0
Time to grab some sleep. Good Night guys. See you soon.
 
Upvote 0
Rich (BB code):
=IF(C1="","",_xlfn.CONCAT(D1:INDEX(D:D,IFERROR(_xlfn.AGGREGATE(15,6,ROW(C1:C9)/(C2:C10<>""),1),ROW()+10))))

Your formula indicates 2 problems that will need to be addressed for the 2007 version.

The '_xlfn.' portions of the formula is excel indicating that the function is not supported in that version of Excel.
1) _xlfn.CONCAT
2) _xlfn.AGGREGATE

The Concat is easily fixed with one line of code in a UDF, but because I am not that good with formulas, I am not sure how to address the AGGREGATE function that is not supported.

Perhaps someone will chime in with a way to rewrite the formula without AGGREGATE, or suggest a UDF to use for the AGGREGATE function.
 
Upvote 0
The closest formula rewrite for the AGGREGATE I can come up with is:
=IF(C2="","",CONCAT(D2:INDEX(D:D,IFERROR(SMALL(IFERROR(ROW(C2:C10)/(C3:C11<>""),""),1),ROW()+10))))

But that is not quite right because as I stated, I am not good with formulas.
 
Upvote 0
If interested, here is another code that also appears to do what you want.

VBA Code:
Sub ConcatText()
  Dim rA As Range
  
  With Range("E2:E" & Range("D" & Rows.Count).End(xlUp).Row)
    .Value = .Offset(, -1).Value
    For Each rA In .Offset(, -2).SpecialCells(xlBlanks).Areas
      rA.Cells(0, 3).Value = Join(Application.Transpose(rA.Cells(0, 3).Resize(rA.Rows.Count + 1).Value))
      rA.Offset(, 2).ClearContents
    Next rA
  End With
End Sub
 
Upvote 0
If interested, here is another code that also appears to do what you want.

VBA Code:
Sub ConcatText()
  Dim rA As Range
 
  With Range("E2:E" & Range("D" & Rows.Count).End(xlUp).Row)
    .Value = .Offset(, -1).Value
    For Each rA In .Offset(, -2).SpecialCells(xlBlanks).Areas
      rA.Cells(0, 3).Value = Join(Application.Transpose(rA.Cells(0, 3).Resize(rA.Rows.Count + 1).Value))
      rA.Offset(, 2).ClearContents
    Next rA
  End With
End Sub
I am really overwhelmed at the responses received. Thank you everyone.
 
Upvote 0
Your formula indicates 2 problems that will need to be addressed for the 2007 version.

The '_xlfn.' portions of the formula is excel indicating that the function is not supported in that version of Excel.
1) _xlfn.CONCAT
2) _xlfn.AGGREGATE

The Concat is easily fixed with one line of code in a UDF, but because I am not that good with formulas, I am not sure how to address the AGGREGATE function that is not supported.

Perhaps someone will chime in with a way to rewrite the formula without AGGREGATE, or suggest a UDF to use for the AGGREGATE function.
JohnnyL. It is fine man. It is a very rare case where I have to work on 2007 and with the help of your code I can easily solve the problem which I was facing. As for other versions Eric W's formula is very short and very easy to remember. I could use that even without the code.
Rich (BB code):
=partialconcat(C2:D10," ")
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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