ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Text formating in formula (https://www.excelbanter.com/excel-discussion-misc-queries/81348-text-formating-formula.html)

lasca

Text formating in formula
 
Hi,

I have the following problem:

In cell A1 I have a value of BP/SA, in cell B1 I want the sum of a named
range based on the value in cell A1 ie, "bp_sa", my Formula is thus
"=sum(bp_sa)".

I need to do a formula that will link the value from A1 and come up with
this, =sum(substitute(A1,"/","_"), The result is =sum("BP_SA") INSTEAD OF
=SUM(BP_SA). How do i get rid of the quotes around the returned value of
bp_sa.

Thx


Bob Phillips

Text formating in formula
 
=SUM(INDIRECT(SUBSTITUTE(A1,"/","_")))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"lasca" wrote in message
...
Hi,

I have the following problem:

In cell A1 I have a value of BP/SA, in cell B1 I want the sum of a named
range based on the value in cell A1 ie, "bp_sa", my Formula is thus
"=sum(bp_sa)".

I need to do a formula that will link the value from A1 and come up with
this, =sum(substitute(A1,"/","_"), The result is =sum("BP_SA") INSTEAD OF
=SUM(BP_SA). How do i get rid of the quotes around the returned value of
bp_sa.

Thx




Toppers

Text formating in formula
 

=SUM(INDIRECT(SUBSTITUTE(A1,"/","_")))

HTH

"lasca" wrote:

Hi,

I have the following problem:

In cell A1 I have a value of BP/SA, in cell B1 I want the sum of a named
range based on the value in cell A1 ie, "bp_sa", my Formula is thus
"=sum(bp_sa)".

I need to do a formula that will link the value from A1 and come up with
this, =sum(substitute(A1,"/","_"), The result is =sum("BP_SA") INSTEAD OF
=SUM(BP_SA). How do i get rid of the quotes around the returned value of
bp_sa.

Thx


lasca

Text formating in formula
 
Thx!!!!! It worked

"Toppers" wrote:


=SUM(INDIRECT(SUBSTITUTE(A1,"/","_")))

HTH

"lasca" wrote:

Hi,

I have the following problem:

In cell A1 I have a value of BP/SA, in cell B1 I want the sum of a named
range based on the value in cell A1 ie, "bp_sa", my Formula is thus
"=sum(bp_sa)".

I need to do a formula that will link the value from A1 and come up with
this, =sum(substitute(A1,"/","_"), The result is =sum("BP_SA") INSTEAD OF
=SUM(BP_SA). How do i get rid of the quotes around the returned value of
bp_sa.

Thx



All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com