ENDSWITH


Returns TRUE if text ends with a certain value, otherwise FALSE

Syntax:

ENDSWITH(text, value)


ENDSWITH checks value against text looking at the end of text. It returns TRUE if text ends with value, otherwise returns FALSE.


Example:

ENDSWITH("Hello", "o")

returns TRUE


ENDSWITH("Hello", "b")

returns FALSE


Text:


Value:


Result:

TRUE

Application:

Let's say you have a list of filenames in column A and you want to check which ones are PDF documents. You can use the ENDSWITH function in column B to determine this.


Table:

Filename

Is PDF?

A
B
1
project_report.pdf
TRUE
2
presentation.pptx
FALSE
3
contract_agreement.pdf
TRUE
4
final_data.xlsx
FALSE

The syntax for the function is ENDSWITH(text, ending_text).

  • text: This is the main string of text you are checking. In our example, this is the filename in column A.
  • ending_text: This is the specific sequence of characters you are looking for at the end of the text. In our example, this is ".pdf".


The function then returns a simple result: TRUE if the text ends with the ending_text, and FALSE if it does not.


Here is a breakdown of how it works for each row in the table:

  • For Row 1: The formula is ENDSWITH(A1, ".pdf").
    • text is the filename "project_report.pdf" from cell A1.
    • ending_text is ".pdf".
    • The filename "project_report.pdf" does indeed end with ".pdf".
    • Result: TRUE
  • For Row 2: The formula is ENDSWITH(A2, ".pdf").
    • text is the filename "presentation.pptx" from cell A2.
    • ending_text is ".pdf".
    • The filename "presentation.pptx" ends with ".pptx", not ".pdf".
    • Result: FALSE
  • For Row 3: The formula is ENDSWITH(A3, ".pdf").
    • text is the filename "contract_agreement.pdf" from cell A3.
    • ending_text is ".pdf".
    • The filename "contract_agreement.pdf" does indeed end with ".pdf".
    • Result: TRUE
  • For Row 4: The formula is ENDSWITH(A4, ".pdf").
    • text is the filename "final_data.xlsx" from cell A4.
    • ending_text is ".pdf".
    • The filename "final_data.xlsx" ends with ".xlsx", not ".pdf".
    • Result: FALSE



This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof