Right function

Last Edited By Krjb Donovan
Last Updated: Mar 05, 2014 09:53 PM GMT

Question

I have two questions:

1. Suppose A1=4 and B1=8 then in C3 i use this formula to suffix lakhs =sum(a1+b1)&" "&"Lakhs" (12 Lakhs). How to prefix Lakhs (Lakhs 12).

2. Let again suppose A1=Nabam Raju. How to pull outin right side(Raju) having variable length? I Hate using this =RIGHT(A1,4) as i have to kept on changing 4.

Answer

Nabam,

first =sum(a1+b1)&" "&"Lakhs" (12 Lakhs) can be changed to: =sum(a1+b1)&" Lakhs" (12 Lakhs)

but to answer the question:


="Lakhs "&sum(a1+b1)    (Lakhs 12)

for question number 2


=Mid(A1,find(" ",A1)+1,255) (Raju)

you can actually calculate the needed length, but using a large number for the length should work as long as the length of the string doesn't exceed the large number - and it is pretty simple. the string produced is still the correct length (in your example, 4 characters) and not 4 characters with a whole bunch of spaces.

=Mid(A1,find(" ",A1)+1,len(A1)-Find(" ",A1))

is the formula if you want to calculate the 3rd argument to be exactly 4 characters.

Advertisement

©2021 eLuminary LLC. All rights reserved.