Excel公式中的增量常数
假设在 Excel 中,我有一个公式 =$C$8+1
,我必须在 1 上添加什么,这样当我拖动时,它就变成 $C$8+2
?
这可以做到吗?
下面是我的实际公式..我希望将 1 增加到 2,使其变为 =2
IF((NOW()-$C8)=1,"1","0")
Suppose, in Excel, I have a formula =$C$8+1
, what must I add to the 1 such that when I drag, it becomes $C$8+2
?
Can this be done?
Below is my actual formula.. I wish to increment 1 to 2 such that it becomes =2
IF((NOW()-$C8)=1,"1","0")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧..可能有多种方法可以做到这一点,但我脑子里唯一想到的方法是使用
=ROW()
函数。假设您从第 5 行开始公式。
=IF((NOW()-$C8)=ROW()-4,"1","0")
=ROW()将返回您当前的行号(在本例中为 5)。因此,在第一行中,我们将有 =1(从 5-4),然后 =2(6-4),依此类推。
不过,您似乎正在比较日期,对吧?我想说你需要截断这些值才能在它们之间进行一天的比较...
=IF((TRUNC(NOW())-TRUNC($C8))=ROW()-4," 1","0")
希望它能有所帮助...或者至少为您提供选择解决方案的途径。
Well.. there might be several ways to do it, but the only one I have in the top of my head is using the
=ROW()
function.Let's say you're starting the formula at row 5.
=IF((NOW()-$C8)=ROW()-4,"1","0")
The =ROW() will return the row number you currently are (i.e. 5, in this case). Thus, in the first row we'll have =1 (from 5-4) and then =2 (6-4) and so on.
Still, it seems you're comparing dates, right? I'd say you'd need to truncate the values to have a day comparison between them...
=IF((TRUNC(NOW())-TRUNC($C8))=ROW()-4,"1","0")
Hope it helps... or at least give you a path to chose your solution.