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))))
 
Ok. Will test it in the office once again tomorrow. Thanks man.🙂
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
What should the correct responses be for data in post #1 using the formula?
 
Upvote 0
It gives the same result as your code but works only in 2019 version. In 2007 I was getting an error.
 
Upvote 0
If you'd rather use a UDF instead of a sub, try this:

VBA Code:
Public Function PartialConcat(target As Range, delim As String) As String
Dim i As Long, MyData As Variant

    Application.Volatile
    If target.Columns.Count <> 2 Then
        PartialConcat = "Incompatible range dimensions"
        Exit Function
    End If
    
    MyData = target.Value
    If MyData(1, 1) = "" Then Exit Function
    PartialConcat = MyData(1, 2)
    For i = 2 To UBound(MyData)
        If MyData(i, 1) <> "" Then Exit Function
        PartialConcat = PartialConcat & delim & MyData(i, 2)
    Next i

End Function

Book3
ABCDE
1DateTextExpected Result
26/1/2022WORKWORK IS WORSHIP
3IS 
4WORSHIP 
56/1/2022NOTHINGNOTHING IS IMPOSSIBLE
6IS 
7IMPOSSIBLE 
86/2/2022HELLOHELLO
96/2/2022HAVEHAVE A NICE DAY
10A 
11NICE 
12DAY 
136/2/2022GOODGOOD MORNING
14MORNING 
156/3/2022IMPOSSIBLEIMPOSSIBLE IS FOR THE UNWILLING
16IS 
17FOR 
18THE 
19UNWILLING 
206/4/2022TRYTRY AGAIN
21AGAIN 
Sheet14
Cell Formulas
RangeFormula
E2:E21E2=partialconcat(C2:D10," ")


Note that if you don't want the space between values, change the formula to:

Excel Formula:
=partialconcat(C2:D10,"")

The second parameter is the delimiter.
 
Upvote 0
=partialconcat(C2:D10,"")
I hope it works in 2007 also. Will update once I check it out tomorrow. As you suggested to go with a code, I gave up to use a formula as you said concat was added in 2019. If the formula works then I will go with it.
Thanks Eric W.
 
Upvote 0
It gives the same result as your code but works only in 2019 version. In 2007 I was getting an error.
I am asking because when I plug in your formula, the result is only the first word of each result.
 
Upvote 0
I am asking because when I plug in your formula, the result is only the first word of each result.
You have to insert this formula in the first cell E1 and drag it down to get the correct result.
Rich (BB code):
=IF(C1="","",_xlfn.CONCAT(D1:INDEX(D:D,IFERROR(_xlfn.AGGREGATE(15,6,ROW(C1:C9)/(C2:C10<>""),1),ROW()+10))))
 
Upvote 0
I hope it works in 2007 also. Will update once I check it out tomorrow. As you suggested to go with a code, I gave up to use a formula as you said concat was added in 2019. If the formula works then I will go with it.
Thanks Eric W.

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.
 
Upvote 0
The issue is I am using 2016 & that has Concatenate, not concat which is different.
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,822
Members
449,470
Latest member
Subhash Chand

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