Vi du ở đây
http://www.excel-easy.com/examples/finđvs-search.html Đặc điểm khác biệt
A2= Excel
=Find("e", A2) --> 4 ( sensitive "e" ở vị trí thư 4)
=Search("e",A2) --> 1 (non-sensitive, ko cần biết "E" hay "e") FIND is
case-sensitive and
does not support wildcards. Use the
SEARCH function to
search without case-sensitivity and/or to use wildcards. SEARCH allows the wildcard characters question mark (?) and asterisk (*), in find_text. The ? matches any single character and the * matches any sequence of characters. To find a literal ? or *, use a tilde (~) before the character, ịẹ ~* and ~?.
=SEARCH(substring,text)
Để ý . ta tìm
Text nằm trong Paragraph Nhưng Search nhả lại số vị trí của Text tìm . Vậy ta cần một logic function để bảo là tìm đúng (So, if SEARCH finds substring, it returns the position as a number, and
ISNUMBER returns TRUẸ )
=ISNUMBER(SEARCH(substring,text))
Vậynếu tại P3 , ta có validation List là Coffee, Xây Dựng , v.v.v...
P4
=IF(ISNUMBER(SEARCH($P$3,B4)), B4, "") Kéo công thức xuống
Đến đây tạm xong, nếu ta muốn hay hơn thì bỏ công thứ c trên vào Advanced filter (VBA). VBA ko qúa 6 hang . Khi xử dung VBA, tốt nhất cho nó copy rồi pasre as Text để mất công thức, béo mỡ nặng files