Option 1: Universal Formula (Excel 2013, 2016, 2019, 365)
Excel Cheque or what you find:
=MID(A2, MIN(IFERROR(SEARCH({"Cheque","Chq","ch"}, A2), 99999)), 20)
Excel
=MID(A2, SEARCH("Cheque", A2), 20)
Option 2: Excel 365 / Excel 2021 Shortcut (TEXTAFTER)
Extract Cheque Number or what you find:
If the cheque number always comes right after Cheque, Chq, or ch:
Excel=TEXTAFTER(A2, {"Cheque","Chq","ch"}, ,, 1)
Excel=MID(A2, AGGREGATE(15, 6, SEARCH({"Cheque","Chq","ch"}, A2), 1), 15)
Option 3: Excel 365 / Excel 2021 Shortcut (TEXTAFTER)
If you want to extract everything after "Cheque", "Chq", or "ch":
Excel=TEXTAFTER(A2, {"Cheque","Chq","ch"}, ,, 1)
Pro Tip: Handle Rows with No Match
To avoid showing #VALUE! or error codes when none of the search terms exist in a cell, wrap the formula in IFERROR:
Excel=IFERROR(MID(A2, AGGREGATE(15, 6, SEARCH({"Cheque","Chq","ch"}, A2), 1), 15), "")

Comments
Post a Comment