将值定义为数字和文本然后添加它们


0

我正在比较公寓,我有专栏,如卧室,全浴室,半浴室,租金,宠物友好,阳台,洗衣房,公用设施,停车场和公交车访问。其中一些有像浴室和租金的数字,而其他像宠物友好和公用事业有像“是”和“包括”这样的词。我找到了一些帮助分配价值,到目前为止我有:

=IF(AND(B2>=1, B2<= 1), 1,
 IF(AND(B2>=2, B2<= 2), 2,
 IF(AND(B2>=3, B2<= 3), 3,
 IF(AND(B2>=4, B2<= 4), 4,
 IF(AND(C2>=1, C2<= 1), 1,
 IF(AND(C2>=2, C2<= 2), 2,
 IF(AND(C2>=3, C2<= 3), 3,
 IF(AND(C2>=4, C2<= 4), 4,
 IF(AND(D2>=1, D2<= 1), 1,
 IF(AND(D2>=2, D2<= 2), 2,
 IF(AND(D2>=3, D2<= 3), 3,
 IF(AND(D2>=4, D2<= 4), 4,
 IF(AND(F2>=0, F2<= 1000), 3,
 IF(AND(F2>=1001, F2<= 1500), 2,
 IF(AND(F2>=1501, F2<= 2000), 3,
 IF(AND(G2="Yes"),1, 
 IF(AND(G2="No"),0,(H2="Yes"),1, 
 IF(AND(H2="No"),0,
 IF(AND(I2="Facility"),0,
 IF(AND(I2="Private"),1,
 IF(AND(J2="Included"),1,
 IF(AND(J2="Not Included"),0,(K2="Yes"),1, 
 IF(AND(K2="No"),0,(L2="Yes"),1, 
 IF(AND(L2="No"),0,))))))))))))))))))))))))))

如何使用这些参数添加行以为每个公寓创建分数?

我的表格截图


1
你为什么这么奇怪AND(X>=N,X<=N)而不是简单X=N
fixer1234

Answers:


0

将此公式粘贴到O2单元格中然后将其向下拖动:

=SUM(B2, C2, D2, IF(AND(F2>0,     F2<1000), 3,
                 IF(AND(F2>=1000, F2<1500), 2,
                 IF(AND(F2>=1500, F2<2000), 3, ))), IF(G2="yes",      1, ),
                                                    IF(H2="yes",      1, ),
                                                    IF(I2="private",  1, ),
                                                    IF(J2="included", 1, ),
                                                    IF(K2="yes",      1, ),
                                                    IF(L2="yes",      1, ))

2


没解释?
Jan Doggen

@JanDoggen如果你需要,我可以加一个。公式对这些单元求和:B2 + C2 + D2 + F2 + G2 + H2 + I2 + J2 + K2 + L2。这相当于3 + 2 + 1 + 3 + 1 + 0 + 1 + 0 + 0 + 1,即12.这些IF块就像开关一样......如果它们是真的,它们会计入给定值(3,2,3) ,1,等等)如果它们没有导致为真,则它们计为0,例如,如果单元格L2 =是计数1,如果L2不是“是”则计数为0.
user0

0

这可能会短得多:

=B2+C2+D2+IFS(F2<=1000,1,F2<=1500,2,TRUE,3)+(I2="Private")+(J2="Included")+ COUNTIF(G2:L2,"Yes")

我假设根据其他租金价值,高达1000的租金应为1而不是3; 但如果确实应该是3,那么只需在公式中更改它。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.