问题
I need to input an equation into excel, I have set a cell to equal N and then I need another cell to hold the information (-((N)/2)), -((N-1)/2)), - ((N-2)/2)),...,0,...,((N-2)/2), ((N-1)/2), ((N)/2))
回答1:
You can use array formula. Suppose, your value N
is in C4
cell.
Select range in one column (for example B1:B20
), then paste following formula:
=($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4))-$C$4))/2
and press CTRL+SHIFT+ENTER to evaluate it.
If you'd like to store data in row, then select range in one row (for example B1:S1
), and paste following formula:
=TRANSPOSE(($C$4-(ROW(INDIRECT($C$4 & ":" & 3* $C$4))-$C$4))/2)
and press CTRL+SHIFT+ENTER to evaluate it.
来源:https://stackoverflow.com/questions/21093364/how-would-i-write-this-equation-into-excel-n-2-n-1-2-n-2-2