[ 本帖最后由 zero409 于 2008-4-13 18:51 编辑 ]作者: tmtony 时间: 2008-4-13 18:14
能否把您的Excel文件传到这里, 有一些示例数据,我直接在里面修改给你作者: zero409 时间: 2008-4-13 18:33 标题: 数据 附件:数据作者: zero409 时间: 2008-4-13 18:47 标题: 简化转换用到的参数关系 WU=A P=B EP=D EU=E EL=F ED=H WL=J WD=K WLM=L C为常数作者: tmtony 时间: 2008-4-13 21:11
C(D-E) <= J <C*L
H=C(D-E)-F
这些公式中 C与(D-E)是什么运算呢作者: tmtony 时间: 2008-4-13 21:12
你试下面的函数
Public Function MyGetValue(A As Double, B As Double, C As Double, D As Double, E As Double, F As Double, H As Double, J As Double, K As Double, L As Double)
If A + B >= D Then
E = D
F = 0
H = 0
Exit Function
End If
If A + B < D And F >= C * L Then
E = A + B
F = (D - E) * J / L
H = 0
Exit Function
End If
If A + B < D And (J >= C(D - E) And J < C * L) Then
E = A + B
F = C(D - E)
H = 0
Exit Function
End If
If A + B < D And C(D - E) > J Then
E = A + B
F = J
H = C(D - E) - F
Exit Function
End If
End Function