EXCEL 公式運算

2015-05-26 5:55 am
之前提及,MR CHAN TAI MAN, JACKY 要轉為Mr Chan Tai-man,Jacky,開頭要加「MR」,但用了下列公式:
假設G行是會員性別,「郵遞收件人」公式為:
=SUBSTITUTE(IF(G3="男","Mr ",IF(G3="女","Ms ",""))&UPPER(LEFT(A3,FIND(" ", A3)))&PROPER(MID(A3,FIND(" ", A3)+1,IF(ISNUMBER(FIND(" ", A3,FIND(" ", A3)+1)),FIND(" ", A3,FIND(" ", A3)+1)-FIND(" ", A3)-1,LEN(A3)-FIND(" ", A3))))&IF(LEN(A3)-LEN(SUBSTITUTE(A3," ",""))>=2,

未能運算,答案表示左右括號沒有配合,怎樣解決?謝!

第二題問題:
邀請嘉賓名單例: A2= DR NGAN TAI MING, SAM , 改為A2=Dr NGAN Tai-ming,sam
B2=UPPER(LEFT(B2,FIND(" ", B2)))&PROPER(MID(B2,FIND(" ", B2)+1,IF(ISNUMBER(FIND(" ", B2,FIND(" ", B2)+1)),FIND(" ", B2,FIND(" ", B2)+1)-FIND(" ", B2)-1,LEN(B2)-FIND(" ", B2))))&IF(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))>=2,"-"&LOWER(RIGHT(B2,LEN(B2)-FIND(" ", B2,FIND(" ", B2)+1))),"")

未能運用,「DR」沒有變「Dr」我做錯了,對嗎?請指正。謝!

第三題問題:
工作表1
A1=會員姓名:
A2=CHAN TAI MAN
C1=通訊地址(項目名稱)
C2=Rm 500 Kwan HXXX House KXXX Hing Estate KXXi CXXXX NT
C3=屯X青X徑6號好X大廈1X樓E室

現在要在C3=地址開頭加「寄:」屯X青X徑6號好X大廈1X樓E室及
C2=地址開頭加「To: 」Mr Chan Tai-man
Rm 500 Kwan HXXX House KXXX Hing Estate KXXi CXXXX NT

怎樣解決,怎樣設定公式,請教教,因我已經輸入了過3000會員地址,謝!

回答 (3)

2015-05-27 1:23 am
✔ 最佳答案
針對第一及第二道問題,建議添加一「頭銜」(Title)欄在A行,原本所有行均右移一行(即A行轉B行、B行轉C行、…),新A行上面放入公式「=IF(H2="男","Mr ",IF(H2="女","Ms ","")」(H行為「性別」),當有特別「頭銜」如「Dr」時在新A行輸入覆寫公式,不輸入時就會按H行「性別」自動放入「Mr」或「Ms」,這樣操作會簡單一些,亦減低有特別「頭銜」資料入漏機會(可隨時在A行用資料篩選功能檢查有多少位Dr),在D2儲存格「郵遞收件人」公式相應修改為:
=SUBSTITUTE(IF(LEN(TRIM(A2))>0,PROPER(TRIM(A2))&" ","")&UPPER(LEFT(B2,FIND(" ", B2)))&PROPER(MID(B2,FIND(" ", B2)+1,IF(ISNUMBER(FIND(" ", B2,FIND(" ", B2)+1)),FIND(" ", B2,FIND(" ", B2)+1)-FIND(" ", B2)-1,LEN(B2)-FIND(" ", B2))))&IF(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))>=2,"-"&LOWER(RIGHT(B2,LEN(B2)-FIND(" ", B2,FIND(" ", B2)+1))),""),LOWER(RIGHT(B2,LEN(B2)-FIND(",",B2)+1)),PROPER(RIGHT(B2,LEN(B2)-FIND(",",B2)+1)))

至於第三道問題,建議添加一欄「郵遞標籤」(Mailing label) 在E行,將「郵遞收件人」、「地址」合併成兩橫列(中間以換行字元CHAR(10)轉至第二列),開頭附加上「寄:」+地址+換行+收件人名(如屬中文)或開頭附加上「To: 」+收件人名+換行+地址(如屬英文)。此「郵遞標籤」行須格式化成為文字可換行(wrap text)才看到換行情況,E2公式如下:
=IF(CODE(LEFT(C2,1))>255,"寄:"&C2&CHAR(10)&D2,"To: "&D2&CHAR(10)&C2)
如果「郵遞收件人」、「郵遞標籤」兩行平時不用,可以隱藏起來,不用佔據屏幕空間,又或者在製作郵遞標籤時才加插兩行放上公式獲取標籤。
2017-04-08 3:25 pm
Chan =LEFT(C4,SEARCH(" ",C4))
Tai =MID(C4,SEARCH(" ",C4)+1,FIND(" ",C4,SEARCH(" ",C4)+1)-FIND(" ",C4))
Man =RIGHT(C4,SEARCH(" ",C4)-2)
2015-05-26 6:03 am
哈哈哈,這個是新帳號和新名字~

但很清楚仍是舊人~

加油!


收錄日期: 2021-04-11 21:03:31
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20150525000051KK00089

檢視 Wayback Machine 備份