我今天要解决的一个具体问题是Excel表格中的借方金额和贷方金额匹配,我们没有共同的标准或查询值。我们只有数字。
我尝试了很多方法,但是都失败了。如果我有一个10
和一个-5,-3,-2
作为信用额,那么我必须手动进行匹配。有什么办法可以使变成零的单元格自动突出显示?有更好的方法吗?
答案 0 :(得分:0)
一种方法是使用求解器
• Put your data in A1:A12
• In B13, put a formula =SUMPRODUCT(A1:A12,B1:B12)
• Set up solver so that B1:12 must be binary (ie 1 or 0)
• In B14 put a "target" score, 100 in your example
• in B15 put =ABS(B13-B14)
• Set solver to look for the minimum value in B15 (to either give you an exact solution with no difference, or closest solution with smallest possible difference)
In this case the simplest solution is setting 100 to "on" (ie 1), all other values es "off" (0)
Screenshot for xl2003 for solving for 367 below (as this is more complex than 100)