CONCATENATE within a SUM forumla

Pedro's PhD

Board Regular
Joined
Jun 3, 2011
Messages
63
Hi,

I am using a simple =CONCATENATE("B",(RIGHT(C12,4)))

The result of this formula returns B3345 which is good, but i then want to integrate this into a simple SUM formula,

eg, =SUM(B3345:B6000)

How can i integrate the CONCATENATE and SUM formula into one?

Thanks

Pedro
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi,

I am using a simple =CONCATENATE("B",(RIGHT(C12,4)))

The result of this formula returns B3345 which is good, but i then want to integrate this into a simple SUM formula,

eg, =SUM(B3345:B6000)

How can i integrate the CONCATENATE and SUM formula into one?

Thanks

Pedro
Try this...

Let's assume A1 = B3345

=SUM(INDIRECT(A1):B6000)
 
Upvote 0
Hi,

I am using a simple =CONCATENATE("B",(RIGHT(C12,4)))

The result of this formula returns B3345 which is good, but i then want to integrate this into a simple SUM formula,

eg, =SUM(B3345:B6000)

How can i integrate the CONCATENATE and SUM formula into one?

Thanks

Pedro

Try this...

Let's assume A1 = B3345

=SUM(INDIRECT(A1):B6000)
Or, you can do the concatenation directly in the formula like this...

=SUM(INDIRECT("B"&RIGHT(C12,4)):B6000)
 
Upvote 0
First off, you do not need to use the CONCATENATE function, just link your items together with an ampersand. Your posted CONCATENATE formula can be written like this...

="B"&RIGHT(C12,4)

As for your SUM formula, you need to use the INDIRECT formual to from your range so that Excel sees it as a range and not text. You can either create the entire range in text and then apply the INDIRECT function to that...

=SUM(INDIRECT("B"&RIGHT(C12,4)&":B6000"))

or you can restrict the INDIRECT function to just the text you are forming...

=SUM(INDIRECT("B"&RIGHT(C12,4)):B6000)

In the first case, the B6000 will never change if you insert/delete rows or columns or if you copy/move the formula because that address is formed from text and Excel doesn't see it until the INDIRECT function evaluates it. In the second case, the B6000 is a real Excel range and will change like any other range reference when rows or columns are inserte/deleted or the cell is copied, etc.
 
Upvote 0
=SUM(INDIRECT(A1):B6000)

I'm surprised this works - wouldn't have expected that syntax to be supported, to the point where I've spent time coming up with workarounds!
 
Upvote 0
First off, you do not need to use the CONCATENATE function, just link your items together with an ampersand. Your posted CONCATENATE formula can be written like this...

="B"&RIGHT(C12,4)

As for your SUM formula, you need to use the INDIRECT formual to from your range so that Excel sees it as a range and not text. You can either create the entire range in text and then apply the INDIRECT function to that...

=SUM(INDIRECT("B"&RIGHT(C12,4)&":B6000"))

or you can restrict the INDIRECT function to just the text you are forming...

=SUM(INDIRECT("B"&RIGHT(C12,4)):B6000)

In the first case, the B6000 will never change if you insert/delete rows or columns or if you copy/move the formula because that address is formed from text and Excel doesn't see it until the INDIRECT function evaluates it. In the second case, the B6000 is a real Excel range and will change like any other range reference when rows or columns are inserte/deleted or the cell is copied, etc.

Thanks Rick, very helpful explanation.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,716
Members
452,939
Latest member
WCrawford

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