Yahoo奇摩知識+將於 2021 年 5 月 4 日 (美國東部時間) 終止服務。自 2021 年 4 月 20 日 (美國東部時間) 起,Yahoo奇摩知識+服務將會轉為唯讀模式。其他Yahoo奇摩產品與服務或您的Yahoo奇摩帳號都不會受影響。如需關於Yahoo奇摩知識+ 停止服務以及下載您個人資料的資訊,請參閱說明網頁。
請問EXCEL邏輯問題
請問我這段哪裡錯了呢?謝謝!
=IF(D4=1,IF(N9=1,"A",IF(N9=2,"B",IF(N9=3,"C",IF(N9=4,"D",IF(N9=5,"E",IF(N9=6,"F",IF(N9=7,"G",IF(N9=8,"H",IF(N9=9,"I",IF(N9=10,"N",IF(D4=2,IF(N9=1,"N",IF(N9=2,"I",IF(N9=3,"H",IF(N9=4,"G",IF(N9=5,"F",IF(N9=6,"E",IF(N9=7,"D",IF(N9=8,"C",IF(N9=9,"B",IF(N9=10,"A",""))))))))))))))))))))))
9 個解答
- ?Lv 77 年前最佳解答
=IF(D4=1,MID("ABCDEFGHIN",N9,1),IF(D4=2,MID("NIHGFEDCBA",N9,1),""))
IF函數有7層的限制,版大用的層數太多,因此EXCEL無法判斷
2014-05-17 12:01:02 補充:
亦可寫為:
=IF(OR(D4={1,2}),MID(CHOOSE(D4,"ABCDEFGHIN","NIHGFEDCBA"),N9,1),"")
如D4有更多種時,用此方法較為簡單
2014-05-17 16:26:12 補充:
=MID("ABCDEFGHIN",(D4=2)*11-N9*-1^D4,1)
2014-05-17 16:52:31 補充:
所以
=IF(OR(D4={1,2}),MID("ABCDEFGHIN",(D4=2)*11-N9*-1^D4,1),"")
2014-05-19 09:18:29 補充:
IF函數有7層的限制,版大用的層數太多,因此EXCEL無法判斷使用
可改為:
=IF(D4=1,MID("ABCDEFGHIN",N9,1),IF(D4=2,MID("NIHGFEDCBA",N9,1),"")) 或進一步的簡化公式:
=IF(OR(D4={1,2}),MID("ABCDEFGHIN",(D4=2)*11-N9*-1^D4,1),"")
若D4有更多的可能性,則公式可寫為:
=IF(OR(D4={1,2}),MID(CHOOSE(D4,"ABCDEFGHIN","NIHGFEDCBA"),N9,1),"") 此時更易作修改
- 匿名使用者7 年前
>這家不錯*****買幾次啦真的一樣
劓侓
- 老夥Lv 77 年前
=IF(D4=1,LOOKUP(N9,{1,2,3,4,5,6,7,8,9,10},{"A","B","C","D","E","F","G","H","I","N"}),
2014-05-17 10:51:47 補充:
IF(D4=2,LOOKUP(N9,{1,2,3,4,5,6,7,8,9,10},{"N","I","H","G","F","E","D","C","B","A"}),""))
續接意見2(字數超過)
2014-05-18 16:22:41 補充:
僅供參考,請諸位專家大師自行轉PO正解。