开发者

Increment constant in Excel Formula

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")


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜