Stripping the Quotes from Concatenate Result to Use in Formula

mbabla

New Member
Joined
Sep 10, 2014
Messages
4
So, I have used concatenate often in my spreadsheets. But I have encountered this situation in using it.

I have an output from the Concatenate formula that is like this,
$A5:$P5

It is dynamically generated with the input being two MATCH functions, i.e.,
=CONCATENATE($A",MATCH(B1,MainSht!$E1:$E1000,0),":$P",MATCH(B1,MainSht!$E1:$E7000,0))


<tbody>
</tbody>
I am trying to use that as an input in a formula
Large($A5:$P5,1)

to dynamically find the largest value in a row, or the 2nd largest, etc.

I can get Large($A5:$P5,1) to work
and I can get the output of the concatenate to be
Large($A5:P5,1)

but when I do
=Large(CONCATENATE($A",MATCH(B1,MainSht!$E1:$E1000,0),":$P",MATCH(B1,MainSht!$E1:$E7000,0)),1)

it does not work, and I found out its because the output of concatenate is a text string with quotes, i.e.,
"$A5:$P5"

and the array formula cannot read that. It needs to strips the quotes.

Any ideas?

Best,

Bob

<tbody>
</tbody>
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Code:
=LARGE(INDIRECT(CONCATENATE("$A",MATCH(B1,MainSht!$E1:$E1000,0),":$P",MATCH(B1,MainSht!$E1:$E7000,0))),1)


Try that.
 
Upvote 0
Hi NeonRedSharpie,

Thanks for your response. That does not work.

In fact,

the subset to that,


=INDIRECT(CONCATENATE("$A",MATCH(B1,MainSht!$E1:$E1000,0),":$P",MATCH(B1,MainSht!$E1:$E7000,0)))</pre> returns an error, i.e., the problem is still that the output of concatenate is a text string with quotes around it, i.e.,
"$A1:$P1000"
and not what any formula input wants, which is
$A1:$P1000

What I am looking for is a way to convert that text output, to get rid of the quotes around it, so that it can be used in a formula.

Thanks,

Bob
 
Upvote 0
Indirect takes a text string (something with quotes) and returns it as a cell reference. Try this:

Code:
=SUM(INDIRECT(CONCATENATE("A","5",":","P","5")))


You will see it returns a value (assuming A5:P5 is populated with numbers).

Indirect's entire job is to take a text reference to a cell and turn it into a direct reference to said cell.
 
Upvote 0
Hi NeonRedSharpie:

Thanks! You are right. It works. I had a sheet reference that I did not include in the e.g. earlier - putting it back in, it did work.

Thanks again for your help.

Best,

Bob
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,334
Members
449,077
Latest member
Jocksteriom

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