VB.NET如何实现Excel中首尾数值的差值计算公式?
- 内容介绍
- 文章标签
- 相关推荐
本文共计315个文字,预计阅读时间需要2分钟。
我有一以下列表(使用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|
我有以下列:(使用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不是必需的. (我想在Cell C2中使用diff)
我想当用户在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)
本文共计315个文字,预计阅读时间需要2分钟。
我有一以下列表(使用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|
我有以下列:(使用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不是必需的. (我想在Cell C2中使用diff)
我想当用户在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)

