XL2000: Using Noncontiguous Ranges in Array Functions (214117)



The information in this article applies to:

  • Microsoft Excel 2000

This article was previously published under Q214117

SUMMARY

Microsoft Excel functions that take arrays as arguments, such as LINEST, LOGEST, IRR, MIRR, MDETERM, NPV, RATE, and XIRR, cannot accept noncontiguous ranges of data as their array arguments. This article shows you how to work around this limitation. You must either copy the ranges to a contiguous area or enter the values as constants, as the following two workarounds describe.

MORE INFORMATION

The example below shows how to use these workarounds with the LINEST function.

Example

LINEST uses regression analysis to estimate a straight line to fit known data. Here the known_x's are in a noncontiguous range:
   A1: X1          B1:     C1: X3       D1: Y1
   A2: 2,310       B2:     C2: 20       D2: 142,000
   A3: 2,333       B3:     C3: 12       D3: 144,000
				

Workaround 1

Copy the data so it is in a contiguous area of the worksheet and enter the data as a contiguous range reference. For example, copy the data in columns A and C into columns E and F and enter the following formula in cell A5 as an array (CTRL+SHIFT+ENTER):

=LINEST(D2:D3,E2:F3,,TRUE)

Workaround 2

Enter the data values into the function as array constants, rather than using a range reference. For example, enter the following formula in cell A5 as an array (CTRL+SHIFT+ENTER):

=LINEST(D2:D3,{2310,20;2333,12},,TRUE)

REFERENCES

For more information about using array constants in formulas, click Microsoft Excel Help on the Help menu, type values that do not change in array formulas in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

For more information about the functions mentioned at the beginning of this article, click Microsoft Excel Help on the Help menu, type the name of the function that you want more information about in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Modification Type:MajorLast Reviewed:9/27/2003
Keywords:kbhowto KB214117