Excel公式中的增量常数

发布于 2024-11-27 03:18:32 字数 202 浏览 0 评论 0原文

假设在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剪不断理还乱 2024-12-04 03:18:32

好吧..可能有多种方法可以做到这一点,但我脑子里唯一想到的方法是使用 =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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文