[英]How can I add in condition for formula in Excel
How can I add in one more condition in the formula for Column D that the number range should also see based on the Type. 如何在D列的公式中添加一个条件,该数字范围也应基于Type看到。
For example, 例如,
Column B is 栏B为
=IF(AND(A2+1<>A3,A2-1<>A1),"start-end",IF(A2+1<>A3,"end",IF(A2-1<>A1,"start","...")))
Column D is D栏是
=IF(AND(OR(B2="start",B2="start-end")),A2,C1)
Column E is =IF(B2="start",INDEX(A2:$A$1048576,MATCH("end",B2:$B$1048576,0)),IF(B2="start-end",D2,E1))
E
=IF(B2="start",INDEX(A2:$A$1048576,MATCH("end",B2:$B$1048576,0)),IF(B2="start-end",D2,E1))
I'm not sure why it needs to be so complicated. 我不确定为什么需要这么复杂。 Why don't you add a
VLOOKUP
? 为什么不添加
VLOOKUP
?
Column G | Column H
886000 | 886000-886019
886020 | 886020-886078
886079 | 886079-886091
=VLOOKUP(A2,$G$2:$H$4,2,TRUE)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.