Translate

Assignment 17 String Function Number of word and last word from a string

 

Assignment 17

String Function


Number of word and last word from a string








Function Used


LEN :- the LEN function return the length of a given text string as the number of characters. LEN will also count characters in numbers.

TRIM :- trim function strips extra spaces from text, leaving only a single space between words and no space characters at the start or end of the text.

SUBSTITUTE :- substitute function replace text in a given string by matching.

Ex:- Substitue ("952-455-7865","-")

return 9524557865,the dash is stripped.

RIGHT :- This function extract a given number of characters from the right side of a supplied text string.

Ex :- RIGHT("apple",3) it return "ple"

REPT :- The rept function repeats characters a given number of times for example-

=REPT("X",5) It return "XXXXX"


Function for "Total word"


=LEN(TRIM(B4))-LEN(SUBSTITUTE(B4," "," "))+1

Note :- This function use for print the total word in a string.


Function for "Last word"


=TRIM(RIGHT(SUBSTITUTE(TRIM(B4)," ",REPT(" ",100)),100))

Note:- This function use for print the last word of a string.


Note :-

This is an assignment based on string function In this assignment there are three columns named as text, total words, last word.

You have to insert the function in yellow columns, criteria are given.

Total word in cell :- This has to count the total word which you are inserting in first columns.

Last word:- Use any function to print the last word from the string.

Post a Comment

0 Comments