Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Is there a way to use subscripts in my formulas?

I use a lot of variables with subscripts. And would like the formatting to
follow the output when I put these in formulas.

i.e. =if(E180,"pr = 7","pr = 0")

I would like the "r" in pr be subscripted when it calculates the formula.
So far I've noticed that it removes all formatting when the formula
calculates. Is there a way around this?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Is there a way to use subscripts in my formulas?

No, you can't part of a cell's value be formatted differently from the rest
when using a formula. However, there is a VB solution that will do what you
want. However, you will need to lock down the range of cells the
functionality will apply to. In other words, when using VB event code, there
is no "copying down" type mechanism available when extending a functionality
across a range... you have to specify the entire range that could ever
possibly be involved before hand. So, tell us what the maximum range of
cells are where you would put your formula and how the formula is to apply
(E18 becomes E19 in next cell down, etc?) and we will try to write the event
code to do what you want. By the way, if the formula you posted is a
simplification for your actual formula, then you will need to tell us your
actual formula as the code will be specific written to duplicate what it
does.

--
Rick (MVP - Excel)


"Neil Cash" wrote in message
...
I use a lot of variables with subscripts. And would like the formatting to
follow the output when I put these in formulas.

i.e. =if(E180,"pr = 7","pr = 0")

I would like the "r" in pr be subscripted when it calculates the formula.
So far I've noticed that it removes all formatting when the formula
calculates. Is there a way around this?

Thanks in advance!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Is there a way to use subscripts in my formulas?

That example was certainly a simplification, and I need the formatting
throughout the entire worksheet. So I don't think I can narrow it down to
one range.

I'm a little familiar with VB and event programming. But not sure how you
could apply the formatting without specifying the specific cells, number of
instances, and basically taking the result and manually applying the
formatting. Seems tedious...

I guess if you can guide me with the right method for this code, I would
appreciate it.

Some things that should be noted:

-There isn't a set range of cells that need this formatting, it's random
throughout
-The formulas can be as complex as
="L x ( ½wLL + ½w"&IF(OR(AND(E23="ˆš",E24="ˆš"),E18=0),""," + ((wp x
a)(2L - a))/(2L²)")&" )"

Where I would need a few select letters of the output to be formatted with
the subscript.

-And I'm thinking it would need to be tied with the Dirty event, and don't
want it to bog down data entry with multiple programming runs.

I'm probably asking for the moon, but I would like to know how this is done
through VB.

Thanks again!

"Rick Rothstein" wrote:

No, you can't part of a cell's value be formatted differently from the rest
when using a formula. However, there is a VB solution that will do what you
want. However, you will need to lock down the range of cells the
functionality will apply to. In other words, when using VB event code, there
is no "copying down" type mechanism available when extending a functionality
across a range... you have to specify the entire range that could ever
possibly be involved before hand. So, tell us what the maximum range of
cells are where you would put your formula and how the formula is to apply
(E18 becomes E19 in next cell down, etc?) and we will try to write the event
code to do what you want. By the way, if the formula you posted is a
simplification for your actual formula, then you will need to tell us your
actual formula as the code will be specific written to duplicate what it
does.

--
Rick (MVP - Excel)


"Neil Cash" wrote in message
...
I use a lot of variables with subscripts. And would like the formatting to
follow the output when I put these in formulas.

i.e. =if(E180,"pr = 7","pr = 0")

I would like the "r" in pr be subscripted when it calculates the formula.
So far I've noticed that it removes all formatting when the formula
calculates. Is there a way around this?

Thanks in advance!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Is there a way to use subscripts in my formulas?

I think VB can still handle what you want, although things might bog down
some if you have a wide-ranging number of formulas (not cell references for
a particular formula "shape", but rather, in the number of formula
"shapes"). Can you give me a list of the characters that would need to be
subscripted and those that would need to be superscripted; also, if there is
any other formatting you would want, tell me the characters and type of
formatting for those as well; and show me one or two formulas that you need
to handle. With them, I'll try to dummy-up some examples so you can see the
type of approach I am thinking about.

--
Rick (MVP - Excel)


"Neil Cash" wrote in message
...
That example was certainly a simplification, and I need the formatting
throughout the entire worksheet. So I don't think I can narrow it down to
one range.

I'm a little familiar with VB and event programming. But not sure how you
could apply the formatting without specifying the specific cells, number
of
instances, and basically taking the result and manually applying the
formatting. Seems tedious...

I guess if you can guide me with the right method for this code, I would
appreciate it.

Some things that should be noted:

-There isn't a set range of cells that need this formatting, it's random
throughout
-The formulas can be as complex as
="L x ( ½wLL + ½w"&IF(OR(AND(E23="ˆš",E24="ˆš"),E18=0),""," + ((wp x
a)(2L - a))/(2L²)")&" )"

Where I would need a few select letters of the output to be formatted
with
the subscript.

-And I'm thinking it would need to be tied with the Dirty event, and
don't
want it to bog down data entry with multiple programming runs.

I'm probably asking for the moon, but I would like to know how this is
done
through VB.

Thanks again!

"Rick Rothstein" wrote:

No, you can't part of a cell's value be formatted differently from the
rest
when using a formula. However, there is a VB solution that will do what
you
want. However, you will need to lock down the range of cells the
functionality will apply to. In other words, when using VB event code,
there
is no "copying down" type mechanism available when extending a
functionality
across a range... you have to specify the entire range that could ever
possibly be involved before hand. So, tell us what the maximum range of
cells are where you would put your formula and how the formula is to
apply
(E18 becomes E19 in next cell down, etc?) and we will try to write the
event
code to do what you want. By the way, if the formula you posted is a
simplification for your actual formula, then you will need to tell us
your
actual formula as the code will be specific written to duplicate what it
does.

--
Rick (MVP - Excel)


"Neil Cash" wrote in message
...
I use a lot of variables with subscripts. And would like the formatting
to
follow the output when I put these in formulas.

i.e. =if(E180,"pr = 7","pr = 0")

I would like the "r" in pr be subscripted when it calculates the
formula.
So far I've noticed that it removes all formatting when the formula
calculates. Is there a way around this?

Thanks in advance!




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Is there a way to use subscripts in my formulas?

Just for a little background, I'm working on a Masonry Lintel design
spreadsheet.

A good example of some of my formulas would be the design load.

I have the user specify the dead load and live load with the following
variables:
wDL and wLL (DL and LL should be subscripted)

Then I have a formula showing the total design load depending on whether or
not Arching Action occurs. If it does occur, then the dead load in this
instance drops from the equation:

=IF(OR(E23="X",E24="X"),"wDL + wlintel + wwall","wlintel + wwall")

For each of the variables I would like to have the first "w" be normal text,
and everything after that first "w" be subscripted. My other functions are
usually a case where if one thing is true use this formula, if not, use this
other formula. So being able to add the subscripts would be visually
appealing.

Thanks for the continued support!



"Rick Rothstein" wrote:

I think VB can still handle what you want, although things might bog down
some if you have a wide-ranging number of formulas (not cell references for
a particular formula "shape", but rather, in the number of formula
"shapes"). Can you give me a list of the characters that would need to be
subscripted and those that would need to be superscripted; also, if there is
any other formatting you would want, tell me the characters and type of
formatting for those as well; and show me one or two formulas that you need
to handle. With them, I'll try to dummy-up some examples so you can see the
type of approach I am thinking about.

--
Rick (MVP - Excel)


"Neil Cash" wrote in message
...
That example was certainly a simplification, and I need the formatting
throughout the entire worksheet. So I don't think I can narrow it down to
one range.

I'm a little familiar with VB and event programming. But not sure how you
could apply the formatting without specifying the specific cells, number
of
instances, and basically taking the result and manually applying the
formatting. Seems tedious...

I guess if you can guide me with the right method for this code, I would
appreciate it.

Some things that should be noted:

-There isn't a set range of cells that need this formatting, it's random
throughout
-The formulas can be as complex as
="L x ( ½wLL + ½w"&IF(OR(AND(E23="ˆš",E24="ˆš"),E18=0),""," + ((wp x
a)(2L - a))/(2L²)")&" )"

Where I would need a few select letters of the output to be formatted
with
the subscript.

-And I'm thinking it would need to be tied with the Dirty event, and
don't
want it to bog down data entry with multiple programming runs.

I'm probably asking for the moon, but I would like to know how this is
done
through VB.

Thanks again!

"Rick Rothstein" wrote:

No, you can't part of a cell's value be formatted differently from the
rest
when using a formula. However, there is a VB solution that will do what
you
want. However, you will need to lock down the range of cells the
functionality will apply to. In other words, when using VB event code,
there
is no "copying down" type mechanism available when extending a
functionality
across a range... you have to specify the entire range that could ever
possibly be involved before hand. So, tell us what the maximum range of
cells are where you would put your formula and how the formula is to
apply
(E18 becomes E19 in next cell down, etc?) and we will try to write the
event
code to do what you want. By the way, if the formula you posted is a
simplification for your actual formula, then you will need to tell us
your
actual formula as the code will be specific written to duplicate what it
does.

--
Rick (MVP - Excel)


"Neil Cash" wrote in message
...
I use a lot of variables with subscripts. And would like the formatting
to
follow the output when I put these in formulas.

i.e. =if(E180,"pr = 7","pr = 0")

I would like the "r" in pr be subscripted when it calculates the
formula.
So far I've noticed that it removes all formatting when the formula
calculates. Is there a way around this?

Thanks in advance!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subscripts James Excel Discussion (Misc queries) 6 July 16th 08 02:25 PM
Superscripts and Subscripts LEW Excel Discussion (Misc queries) 0 November 10th 05 03:06 PM
Is there a way to have "subscripts" in Excel? Sam Excel Discussion (Misc queries) 3 July 18th 05 12:50 PM
How do you make superscripts and subscripts in Excel? Mona Excel Discussion (Misc queries) 2 January 19th 05 12:50 AM


All times are GMT +1. The time now is 09:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"