如何创建一个新列,并将固定值添加到另一列单元格值

发布于 2025-01-22 09:23:55 字数 476 浏览 4 评论 0原文

我有一张桌子看起来像这样

”在此处输入图像说明“

我必须创建一个新列C,其中1个值与B列相同,下一个值应在每个单元格中添加一个fix值20,我该如何执行这?

输出应该看起来像这样:

”在此处输入图像描述”

如果有人可以帮助我,谢谢

I have a table looks like this

enter image description here

I have to create a new column C, with 1st value is the same as column B and next value should add a fix value 20 to each cell, how can I do this?

Output should look like this:

enter image description here

It will be a great help if someone can help me with this, thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

岁月染过的梦 2025-01-29 09:23:55

您可以通过说:

C = ( [A] - 1 ) * 20 + 100

替代方案,如果您在[b]中具有不同的价值,则可以使用LookupValue函数,看起来像这样:

C = ( [A] - 1 ) * 20 + LOOKUPVALUE( Table[B], [B], MAX( [B] ) )

You can just make it by saying:

C = ( [A] - 1 ) * 20 + 100

Alternative if you have a different value in [B] you can use the LOOKUPVALUE function and it'd look like this:

C = ( [A] - 1 ) * 20 + LOOKUPVALUE( Table[B], [B], MAX( [B] ) )
梦旅人picnic 2025-01-29 09:23:55

我不完全确定您的追求,但是我猜这是B中随机值的,并且基于此计算。如果这就是您在说的话,应该有效:

C = 
IF(
    [B] = BLANK(), 
    LOOKUPVALUE( 
        'Table'[B], 
        'Table'[A], 
        CALCULATE( 
            LASTNONBLANK( 'Table'[A], 1),
            FILTER(
                'Table',
                'Table'[A] <= EARLIER( 'Table'[A] )
                    && not ISBLANK( 'Table'[B] )
            ) 
        ) 
    ) +
    ( [A] - CALCULATE(
        LASTNONBLANK('Table'[A], 1),
        FILTER(
            'Table',
            'Table'[A] <= EARLIER( 'Table'[A] )
                && not ISBLANK( 'Table'[B] )
        )
    ) ) * 20,
    [B]
)

这就是一个示例:

“在此处输入图像描述”

I'm not entirely sure what you're after but I'm guessing it's with random values in B and calculations based on that. If that's what you're talking about this should work:

C = 
IF(
    [B] = BLANK(), 
    LOOKUPVALUE( 
        'Table'[B], 
        'Table'[A], 
        CALCULATE( 
            LASTNONBLANK( 'Table'[A], 1),
            FILTER(
                'Table',
                'Table'[A] <= EARLIER( 'Table'[A] )
                    && not ISBLANK( 'Table'[B] )
            ) 
        ) 
    ) +
    ( [A] - CALCULATE(
        LASTNONBLANK('Table'[A], 1),
        FILTER(
            'Table',
            'Table'[A] <= EARLIER( 'Table'[A] )
                && not ISBLANK( 'Table'[B] )
        )
    ) ) * 20,
    [B]
)

This is what an example would look like:

enter image description here

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