[英]How can I conditionally choose a math formula to calculate a value in Excel?
I am trying to produce an interactive Excel-based calculator to produce time estimates based on a selected Activity type and an input Quantity.我正在尝试生成一个基于 Excel 的交互式计算器,以根据选定的活动类型和输入数量生成时间估计。 Each activity type has its own formula to convert the input quantity into its respective time estimate.每种活动类型都有自己的公式将输入数量转换为其各自的时间估计。 The formulas used are based on the activity type and are either linear equations ( mx+b
) or scalars (e,g, .2, 4, etc) to be performed on the input quantity.使用的公式基于活动类型,并且是要对输入量执行的线性方程 ( mx+b
) 或标量(例如 .2、4 等)。
The way I have approached it has brought me to a dead-end.我接近它的方式把我带到了死胡同。 Below is an image of my attempt.下面是我尝试的图像。 Yellow columns are input, Blue columns are returned values.黄色列是输入,蓝色列是返回值。
Column A uses a drop-down menu for the user to select the Activity type. A 列使用一个下拉菜单,供用户使用 select Activity 类型。 {Reading, Writing, Quiz, Term Paper} Column B uses VLOOKUP to return the appropriate unit. {阅读、写作、测验、学期论文} B 列使用 VLOOKUP 返回适当的单位。 {words, questions} {单词,问题}
Column C prompts for a Quantity of that unit. C 列提示输入该单位的数量。 Column D uses Column A and a VLOOKUP again to identify the appropriate formula to calculate the estimate, given the input quantity.给定输入数量,D 列再次使用 A 列和 VLOOKUP 来确定适当的公式来计算估计值。
Works fine in simple cases of scalars eg =C1*VLOOKUP(A3, ARRAY, 3, FALSE)
, but the linear equation has me stuck.在简单的标量情况下工作正常,例如=C1*VLOOKUP(A3, ARRAY, 3, FALSE)
,但线性方程让我卡住了。 I would need to multiply the input value and then subtract from that product.我需要将输入值相乘,然后从该乘积中减去。 In other words, I need to plug in the input value into a VLOOKUP-derived formula.换句话说,我需要将输入值插入到 VLOOKUP 派生的公式中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.