Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default What are {}, how do you use them in IF statements

I'm new to this process and I have previous typed the same question but
haven't seen my question on the internet, so here goes again, probably my
fault.

I am using another person's formula. They have used the following brackets {
}.

Q -
What do they mean.
When I try to amend the formula they disappear {} and the formula stops
working.
How do I activate them and amend them
Why are they different to ().


Thank you in advance dor your help.


Regards


Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default What are {}, how do you use them in IF statements

Curly bracket are used in some function like INDEX (see VBA help below) that
have two forms of the function - Array and Reference. I put the function into
=INDEX({1,2;3,4},0,2 into my excel 2003 and the brackets stayed.


INDEX

See Also

Returns the value of an element in a table or an array, selected by the row
and column number indexes.

The INDEX function has two syntax forms: array and reference. The array form
always returns a value or array of values; the reference form always returns
a reference. Use the array form if the first argument to INDEX is an array
constant.

Syntax 1

Array form

INDEX(array,row_num,column_num)

Array is a range of cells or an array constant.

If array contains only one row or column, the corresponding row_num or
column_num argument is optional.

If array has more than one row and more than one column, and only row_num or
column_num is used, INDEX returns an array of the entire row or column in
array.

Row_num selects the row in array from which to return a value. If row_num
is omitted, column_num is required.

Column_num selects the column in array from which to return a value. If
column_num is omitted, row_num is required.

Remarks

If both the row_num and column_num arguments are used, INDEX returns the
value in the cell at the intersection of row_num and column_num.
If you set row_num or column_num to 0 (zero), INDEX returns the array of
values for the entire column or row, respectively. To use values returned as
an array, enter the INDEX function as an array formula in a horizontal range
of cells for a row, and in a vertical range of cells for a column. To enter
an array formula, press CTRL+SHIFT+ENTER.
Row_num and column_num must point to a cell within array; otherwise, INDEX
returns the #REF! error value.

Example 1

The example may be easier to understand if you copy it to a blank worksheet.

How?

Create a blank workbook or worksheet.
Select the example in the Help topic. Do not select the row or column
headers.


Selecting an example from Help

Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return
the results, press CTRL+` (grave accent), or on the Tools menu, point to
Formula Auditing, and then click Formula Auditing Mode.

1
2
3
A B
Data Data
Apples Lemons
Bananas Pears
Formula Description (Result)
=INDEX(A2:B3,2,2) Value at the intersection of the second row and second
column in the range (Pears)
=INDEX(A2:B3,2,1) Value at the intersection of the second row and first
column in the range (Bananas)


Example 2

The example may be easier to understand if you copy it to a blank worksheet.

How?

Create a blank workbook or worksheet.
Select the example in the Help topic. Do not select the row or column
headers.


Selecting an example from Help

Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return
the results, press CTRL+` (grave accent), or on the Tools menu, point to
Formula Auditing, and then click Formula Auditing Mode.

1
2
3
A B
Formula Description (Result)
=INDEX({1,2;3,4},0,2) Value in the first row, second column in the array
constant (2)
Value in the second row, second column in the array constant (4)


Note The formula in the example must be entered as an array formula. After
copying the example to a blank worksheet, select the range A2:A3 starting
with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the
formula is not entered as an array formula, the single result is 2.


"Paul" wrote:

I'm new to this process and I have previous typed the same question but
haven't seen my question on the internet, so here goes again, probably my
fault.

I am using another person's formula. They have used the following brackets {
}.

Q -
What do they mean.
When I try to amend the formula they disappear {} and the formula stops
working.
How do I activate them and amend them
Why are they different to ().


Thank you in advance dor your help.


Regards


Paul

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default What are {}, how do you use them in IF statements


Joel

Thank you very much for your e-mail. You've blown my mind away, I'm going to
have to study your e-mail in great detail.

Once again thank you.


Best regards


Paul


"Joel" wrote:

Curly bracket are used in some function like INDEX (see VBA help below) that
have two forms of the function - Array and Reference. I put the function into
=INDEX({1,2;3,4},0,2 into my excel 2003 and the brackets stayed.


INDEX

See Also

Returns the value of an element in a table or an array, selected by the row
and column number indexes.

The INDEX function has two syntax forms: array and reference. The array form
always returns a value or array of values; the reference form always returns
a reference. Use the array form if the first argument to INDEX is an array
constant.

Syntax 1

Array form

INDEX(array,row_num,column_num)

Array is a range of cells or an array constant.

If array contains only one row or column, the corresponding row_num or
column_num argument is optional.

If array has more than one row and more than one column, and only row_num or
column_num is used, INDEX returns an array of the entire row or column in
array.

Row_num selects the row in array from which to return a value. If row_num
is omitted, column_num is required.

Column_num selects the column in array from which to return a value. If
column_num is omitted, row_num is required.

Remarks

If both the row_num and column_num arguments are used, INDEX returns the
value in the cell at the intersection of row_num and column_num.
If you set row_num or column_num to 0 (zero), INDEX returns the array of
values for the entire column or row, respectively. To use values returned as
an array, enter the INDEX function as an array formula in a horizontal range
of cells for a row, and in a vertical range of cells for a column. To enter
an array formula, press CTRL+SHIFT+ENTER.
Row_num and column_num must point to a cell within array; otherwise, INDEX
returns the #REF! error value.

Example 1

The example may be easier to understand if you copy it to a blank worksheet.

How?

Create a blank workbook or worksheet.
Select the example in the Help topic. Do not select the row or column
headers.


Selecting an example from Help

Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return
the results, press CTRL+` (grave accent), or on the Tools menu, point to
Formula Auditing, and then click Formula Auditing Mode.

1
2
3
A B
Data Data
Apples Lemons
Bananas Pears
Formula Description (Result)
=INDEX(A2:B3,2,2) Value at the intersection of the second row and second
column in the range (Pears)
=INDEX(A2:B3,2,1) Value at the intersection of the second row and first
column in the range (Bananas)


Example 2

The example may be easier to understand if you copy it to a blank worksheet.

How?

Create a blank workbook or worksheet.
Select the example in the Help topic. Do not select the row or column
headers.


Selecting an example from Help

Press CTRL+C.
In the worksheet, select cell A1, and press CTRL+V.
To switch between viewing the results and viewing the formulas that return
the results, press CTRL+` (grave accent), or on the Tools menu, point to
Formula Auditing, and then click Formula Auditing Mode.

1
2
3
A B
Formula Description (Result)
=INDEX({1,2;3,4},0,2) Value in the first row, second column in the array
constant (2)
Value in the second row, second column in the array constant (4)


Note The formula in the example must be entered as an array formula. After
copying the example to a blank worksheet, select the range A2:A3 starting
with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the
formula is not entered as an array formula, the single result is 2.


"Paul" wrote:

I'm new to this process and I have previous typed the same question but
haven't seen my question on the internet, so here goes again, probably my
fault.

I am using another person's formula. They have used the following brackets {
}.

Q -
What do they mean.
When I try to amend the formula they disappear {} and the formula stops
working.
How do I activate them and amend them
Why are they different to ().


Thank you in advance dor your help.


Regards


Paul

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default What are {}, how do you use them in IF statements

Hi Paul

The curly braces { } around a formula, signifies that it is an array
formula.
The braces appear when you commit or edit a formula using
Control+Shift+Enter (CSE) not just Enter.
You do not type the brackets yourself, Excel will insert them when you use
CSE.

The reason your formula stops working after amending, is you have just
pressed Enter, rather than CSE.

--
Regards
Roger Govier



"Paul" wrote in message
...
I'm new to this process and I have previous typed the same question but
haven't seen my question on the internet, so here goes again, probably my
fault.

I am using another person's formula. They have used the following brackets
{
}.

Q -
What do they mean.
When I try to amend the formula they disappear {} and the formula stops
working.
How do I activate them and amend them
Why are they different to ().


Thank you in advance dor your help.


Regards


Paul



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
IF & OR Statements JG14 Excel Worksheet Functions 4 May 25th 07 11:47 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
If Statements Dbettini Excel Discussion (Misc queries) 1 March 22nd 06 06:22 PM
operator statements, shorting when reusing one of the statements? KR Excel Programming 1 August 4th 05 06:20 PM
7+ if statements JayE Excel Programming 7 February 21st 05 11:00 PM


All times are GMT +1. The time now is 12:29 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"