需要帮助将多单元Excel公式转换为基本伪代码 [英] Need help converting a Multi-Cell Excel formula to basic pseudo code

查看:206
本文介绍了需要帮助将多单元Excel公式转换为基本伪代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为整个电子表格在这里不相关(希望我没错),但本质上我正在处理一些财务数据,并且需要计算出累积成本". 电子表格是正确的,但是我不了解该公式的数学原理,所以我希望有人可以将其分解为BODMAS或伪代码或某种东西(甚至最终将是Java).

I don't think the whole spreadsheet is relevant here (Hope I am not wrong) but essentially I am working with some financial figures and need to work out a "Cumulative Cost". The spreadsheet is correct, but I don't understand the maths of the formula, so I hope somebody can break it down into BODMAS or pseudo code or something (or even Java which it will ultimately be.)

{=(PRODUCT($D$4:D7/100+1)-1)*100}

{=(PRODUCT($D$4:D8/100+1)-1)*100}

{=(PRODUCT($D$4:D9/100+1)-1)*100}

等.

我认为我只需要提供一个公式,而仅给出一些更多的上下文即可.

I think I only needed to supply one formula, but just giving a few more for context.

因此,以上公式可在E列中找到: 表的屏幕截图

So the formulas above are found in column E: Screenshot of Table

谢谢!

推荐答案

公式的一部分/100+1从百分比变化中转换. -1)*100部分转换为百分比变化. PRODUCT()将数字相乘.

The part of the formula, /100+1, converts from a percentage change. The part, -1)*100, converts to a percentage change. PRODUCT() multiplies the numbers togther.

double d[12], e[12]; // input and output arrays, respectively
double p = 1.0; // to accumulate the product

for (i = 0; i < 12; i++)
{
    p = p * ((d[i] / 100) + 1);  // convert from percentage and multiply
    e[i] = (p - 1) * 100;        // convert to percentage
}

为清楚起见,还添加了()以及空格.

Additional ( and ) and spaces added for clarity.

这篇关于需要帮助将多单元Excel公式转换为基本伪代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆