gpt4 book ai didi

vb.net - Excel公式计算列中第一个值和最后一个值的差异(Excel)?

转载 作者:行者123 更新时间:2023-12-02 14:55:39 24 4
gpt4 key购买 nike

我有以下列:(使用 Excel 公式)

     A            B
------------------------
1 | Date | Value |
------------------------
2 | 8/20/2011 | 92.8 |
3 | 8/21/2011 | 92.4 |
4 | 8/22/2011 | 91.8 |
5 | 8/23/2011 | 90.7 |
6 | 8/24/2011 | 91.1 |
7 | 8/25/2011 | |
8 | 8/26/2011 | |
9 | 8/27/2011 | |
------------------------

I want to calculate the difference between 1st Value (B2) and last Value (last populated row in column B)

已编辑:

使用公式:=B2-B6 不是必需的。 (我想要单元格 C2 中的差异)

我希望当用户在 B7 中输入值时,它会自动显示 B2 和 B7 之间的差异,当他填充 B8 时,它会显示 B2 和 B8 之间的差异,依此类推。

I don't want some direct method to do this in Excel and not by iterating all values to check the last value. Please suggest the best method to this in Excel.

这更像是一个逻辑问题!

欢迎使用纯 Excel 解决方案,我可以手动完成。

编辑:使用 Excel 公式!

我希望我正确解释了我的问题..

最佳答案

如果标题位于 A1 和 B1 中,并且您的表格为 A2:B9,请使用以下公式:

=$B$2-OFFSET($B$2,COUNTA($B$2:$B$9)-1,0,1,1)

关于vb.net - Excel公式计算列中第一个值和最后一个值的差异(Excel)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7213061/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com