Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 224
Default Formatting in formulas not allowed before commas

If I format a formula with carriage returns and spaces for clarity,
any carriage returns or spaces right before a comma are removed by
Excel. For example, if I do this:
(Yes, I realize this formula doesn't make sense; it's just a simple
example to illustrate the problem.)

=IF(
OR(
TRUE,TRUE
)
,TRUE,TRUE
)

As soon as press Enter, Excel changes it to this:

=IF(
OR(
TRUE,TRUE
),TRUE,TRUE
)

That happens with carriage returns right before commas, spaces right
before commas, and any combination of them right before commas.

Is there any way around that? The best I've been able to do is just do
the formatting after the comma instead of before it:

=IF(
OR(
TRUE,TRUE
),
TRUE,TRUE
)


Thanks,

Greg
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Formatting in formulas not allowed before commas

Sorry, Greg. I can't see the difference between your "before" and "after"
formulas. It will also help if you tell us what version of Excel you are
using.

As a general answer, Excel reformats all formulas to remove spaces and
change the function names and cell addresses to upper case.

Regards,
Fred

"Greg Lovern" wrote in message
...
If I format a formula with carriage returns and spaces for clarity,
any carriage returns or spaces right before a comma are removed by
Excel. For example, if I do this:
(Yes, I realize this formula doesn't make sense; it's just a simple
example to illustrate the problem.)

=IF(
OR(
TRUE,TRUE
)
,TRUE,TRUE
)

As soon as press Enter, Excel changes it to this:

=IF(
OR(
TRUE,TRUE
),TRUE,TRUE
)

That happens with carriage returns right before commas, spaces right
before commas, and any combination of them right before commas.

Is there any way around that? The best I've been able to do is just do
the formatting after the comma instead of before it:

=IF(
OR(
TRUE,TRUE
),
TRUE,TRUE
)


Thanks,

Greg


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Formatting in formulas not allowed before commas

<change the function names and cell addresses to upper case

In fact Excel changes them to how they were defined. And Built-in functions
are always defined in uppercase.
But if you have a UDF that is defined in upper-and lowecase mix, Excel will
change it to match the definition, even if you type it in all lowercase.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Fred Smith" wrote in message
...
Sorry, Greg. I can't see the difference between your "before" and "after"
formulas. It will also help if you tell us what version of Excel you are
using.

As a general answer, Excel reformats all formulas to remove spaces and
change the function names and cell addresses to upper case.

Regards,
Fred

"Greg Lovern" wrote in message
...
If I format a formula with carriage returns and spaces for clarity,
any carriage returns or spaces right before a comma are removed by
Excel. For example, if I do this:
(Yes, I realize this formula doesn't make sense; it's just a simple
example to illustrate the problem.)

=IF(
OR(
TRUE,TRUE
)
,TRUE,TRUE
)

As soon as press Enter, Excel changes it to this:

=IF(
OR(
TRUE,TRUE
),TRUE,TRUE
)

That happens with carriage returns right before commas, spaces right
before commas, and any combination of them right before commas.

Is there any way around that? The best I've been able to do is just do
the formatting after the comma instead of before it:

=IF(
OR(
TRUE,TRUE
),
TRUE,TRUE
)


Thanks,

Greg



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Formatting in formulas not allowed before commas

Not always, I just noticed. I'll try to find out when it does and when it
doesn't

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Niek Otten" wrote in message
...
<change the function names and cell addresses to upper case

In fact Excel changes them to how they were defined. And Built-in
functions are always defined in uppercase.
But if you have a UDF that is defined in upper-and lowecase mix, Excel
will change it to match the definition, even if you type it in all
lowercase.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Fred Smith" wrote in message
...
Sorry, Greg. I can't see the difference between your "before" and "after"
formulas. It will also help if you tell us what version of Excel you are
using.

As a general answer, Excel reformats all formulas to remove spaces and
change the function names and cell addresses to upper case.

Regards,
Fred

"Greg Lovern" wrote in message
...
If I format a formula with carriage returns and spaces for clarity,
any carriage returns or spaces right before a comma are removed by
Excel. For example, if I do this:
(Yes, I realize this formula doesn't make sense; it's just a simple
example to illustrate the problem.)

=IF(
OR(
TRUE,TRUE
)
,TRUE,TRUE
)

As soon as press Enter, Excel changes it to this:

=IF(
OR(
TRUE,TRUE
),TRUE,TRUE
)

That happens with carriage returns right before commas, spaces right
before commas, and any combination of them right before commas.

Is there any way around that? The best I've been able to do is just do
the formatting after the comma instead of before it:

=IF(
OR(
TRUE,TRUE
),
TRUE,TRUE
)


Thanks,

Greg




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Formatting in formulas not allowed before commas

I remember again

In Excel5, VBA was still "a part of Excel"; it was very close to Excel and
the two exchanged more information. One such thing is the capitalization of
function names. That was lost in Excel97, when VBA became a more separate
component.
There were more such losses of functionality then.

Excel4 functions (XLM) still capitalize the way they were defined. They also
retain the ability for implicite intersection of multi-cell arguments, just
like Excel built-in functions do. But that's another story.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel



"Niek Otten" wrote in message
...
Not always, I just noticed. I'll try to find out when it does and when it
doesn't

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Niek Otten" wrote in message
...
<change the function names and cell addresses to upper case

In fact Excel changes them to how they were defined. And Built-in
functions are always defined in uppercase.
But if you have a UDF that is defined in upper-and lowecase mix, Excel
will change it to match the definition, even if you type it in all
lowercase.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Fred Smith" wrote in message
...
Sorry, Greg. I can't see the difference between your "before" and
"after" formulas. It will also help if you tell us what version of Excel
you are using.

As a general answer, Excel reformats all formulas to remove spaces and
change the function names and cell addresses to upper case.

Regards,
Fred

"Greg Lovern" wrote in message
...
If I format a formula with carriage returns and spaces for clarity,
any carriage returns or spaces right before a comma are removed by
Excel. For example, if I do this:
(Yes, I realize this formula doesn't make sense; it's just a simple
example to illustrate the problem.)

=IF(
OR(
TRUE,TRUE
)
,TRUE,TRUE
)

As soon as press Enter, Excel changes it to this:

=IF(
OR(
TRUE,TRUE
),TRUE,TRUE
)

That happens with carriage returns right before commas, spaces right
before commas, and any combination of them right before commas.

Is there any way around that? The best I've been able to do is just do
the formatting after the comma instead of before it:

=IF(
OR(
TRUE,TRUE
),
TRUE,TRUE
)


Thanks,

Greg






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 224
Default Formatting in formulas not allowed before commas

On Feb 3, 6:21*am, "Fred Smith" wrote:
Sorry, Greg. I can't see the difference between your "before" and "after"
formulas.


Hi Fred,

In the "before" formula, the IF function's 2nd and 3rd arguments are
on the next line below the OR function's closing parenthesis.

In the "after formula, the IF function's 2nd and 3rd arguments are on
the same line as the OR function's closing parenthesis -- Excel moved
them up a line, removing the carriage return and all spaces between
them.

Try this:

-- Copy the first formula.
-- Paste it into Notepad.
-- Paste it into an Excel cell and press Enter to evaluate it.
-- Copy it from the formula bar.
-- Paste it into Notepad, below what you already pasted into Notepad.
-- See the difference between the two formulas now in Notepad?


It will also help if you tell us what version of Excel you are
using.


I first noticed it in Excel 2007, then checked Excel 97 and found the
same behavior. I just now checked the Excel 2010 public beta and it
does the same. I haven't checked 2003, 2002, or 2000, but I would be
surprised if they were different.


As a general answer, Excel reformats all formulas to remove spaces


Not true. Try this:

= IF( TRUE, TRUE, TRUE )

There are 25 spaces in that formula. Excel accepts them, evaluates the
formula the same as it would without the spaces, and preserves the
spaces.

However, if you try to put a space between a function name and it's
opening parenthesis, Excel will remove all spaces in the formula.


Greg
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
Password Protect Sheet with formatting allowed CER Excel Discussion (Misc queries) 3 November 3rd 09 09:25 PM
commas in formulas Flipper Excel Discussion (Misc queries) 3 December 23rd 08 02:55 PM
Number of "array" Formulas Allowed? Ken Excel Discussion (Misc queries) 0 November 4th 08 01:13 PM
Formatting and seperating commas Help Excel Discussion (Misc queries) 3 May 2nd 07 03:36 AM
delete commas in spreadsheet but not in formulas cynwalker Excel Discussion (Misc queries) 2 January 24th 07 01:05 AM


All times are GMT +1. The time now is 11:06 PM.

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

About Us

"It's about Microsoft Excel"