Applies ToSharePoint Server 订阅版 SharePoint Server 2019 SharePoint Server 2016 SharePoint Server 2013 SharePoint Server 2013 企业版 Microsoft 365 中的 SharePoint SharePoint Foundation 2010 SharePoint Server 2010 Microsoft 365 小型企业版中的 SharePoint Windows SharePoint Services 3.0

Uses index_num to return a value from the list of value arguments. Use CHOOSE to select one of up to 29 values based on the index number. For example, if value1 through value7 are the days of the week, CHOOSE returns one of the days when a number between 1 and 7 is used as index_num.

Syntax

CHOOSE(index_num,value1,value2,...)

Index_num     specifies which value argument is selected. Index_num must be a number between 1 and 29, or a formula or column reference containing a number between 1 and 29.

  • If index_num is 1, CHOOSE returns value1; if it is 2, CHOOSE returns value2; and so on.

  • If index_num is less than 1 or greater than the number of the last value in the list, CHOOSE returns the #VALUE! error value.

  • If index_num is a fraction, it is truncated to the lowest integer before being used.

Value1,value2,...     are 1 to 29 value arguments from which CHOOSE selects a value or an action to perform based on index_num. The arguments can be numbers, column references, formulas, functions, or text.

Example 1

Col1

Col2

Col3

Col4

Formula

Description (Result)

1st

2nd

3rd

Finished

=CHOOSE(2,[Col1],[Col2],[Col3],[Col4])

Value from the second argument Col2 (2nd)

Nails

Screws

Nuts

Bolts

=CHOOSE(4,[Col1],[Col2],[Col3],[Col4])

Value from the fourth argument Col4 (Bolts)

Example 2

Col1

Col2

Col3

Col4

Formula

Description (Result)

23

45

12

10

=SUM([Col1], CHOOSE(2,[Col2],[Col3],[Col4]))

Sums the two arguments Col1 and the result of the Choose function (35)

需要更多帮助?

需要更多选项?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.