我的公式长了点,用了四个函数:
(1)IF (2)CEILING (3)FIND (4)ISERROR
第一题:
D2=CHOOSE(IF(ISERROR(CEILING(FIND(A2&B2,"木火木,火土火,土金土,金水金,水木水,木土木,火金火,土水土,金木金,水火水,風火風,風土風,風金風,風水風,風木風,雷火雷,雷土雷,雷金雷,雷水雷,雷木雷"),4)/4),21,CEILING(FIND(A2&B2,"木火木,火土火,土金土,金水金,水木水,木土木,火金火,土水土,金木金,水火水,風火風,風土風,風金風,風水風,風木風,雷火雷,雷土雷,雷金雷,雷水雷,雷木雷"),4)/4),"木生火","火生土","土生金","金生水","水生木","木剋土","火剋金","土剋水","金剋木","水剋火","火生風","土生風","金生風","水生風","木生風","雷剋火","雷剋土","雷剋金","雷剋水","雷剋木","無屬性")
第二题:
D2=IF(CEILING(FIND(A2,"將士象車馬包卒帥仕相俥傌炮兵"),7)/7=CEILING(FIND(B2,"將士象車馬包卒帥仕相俥傌炮兵"),7)/7,"同國聯盟",IF(CEILING(FIND(A2,"將帥士仕象相車俥馬傌包炮卒兵"),2)=CEILING(FIND(B2,"將帥士仕象相車俥馬傌包炮卒兵"),2),"無勝負",IF(ISERROR(FIND(A2&B2,"將兵將,帥卒帥,")),IF(FIND(A2,"將帥士仕象相車俥馬傌包炮卒兵")<FIND(B2,"將帥士仕象相車俥馬傌包炮卒兵"),A2&"勝"&B2,B2&"勝"&A2),IF(CEILING(FIND(A2&B2,"將兵將,帥卒帥,"),4)=4,"兵勝將","卒勝帥"))))
附件: |