Camel case converter in an excel - excel

I am trying to convert a field in an excel sheet (e.g. REC_LEN) to camel case. I am using this formula to do that
=LEFT(A1) & RIGHT(SUBSTITUTE(PROPER(A1),"_",""), LEN( SUBSTITUTE(A1,"_",""))-1)
This is giving me results like RecLen. I want to convert my first letter to lowercase too (The expected output is recLen). Can somebody help me out with this? I am not too familiar with excel formulae. Not sure if this has been already asked before but any help is much appreciated.

Try this:
=LOWER(LEFT(A1)) & MID(SUBSTITUTE(PROPER(A1),"_",""),2,LEN(A1))
With Office 365 we can use:
=LET(
rr,A1,
x,TEXTSPLIT(rr,"_"),
CONCAT(LOWER(TAKE(x,,1)),PROPER(DROP(x,,1))))

Just use =PROPER(A1) on the another cell and you have it done.

=LOWER(LEFT(A1)) & MID(A1,2,LEN(A1))
This works perfectly for creating camel case when there is no space or underscore between words.
So HelloWorld will become helloWorld.

You were so close! Just wrap your left expression in a LOWER:
=LOWER(LEFT(A1)) & RIGHT(SUBSTITUTE(PROPER(A1),"_",""), LEN( SUBSTITUTE(A1,"_",""))-1)

using replace,
=LOWER(LEFT(A1,FIND("_",A1)-1))&PROPER(REPLACE(A1,1,FIND("_",A1),""))

Related

How can I transform the string in excel

I'm looking for a way to transform a string like 'TRSP_INV_CD' to 'TrspInvCd' in excel.
I will be very grateful if anyone can give me a solution to this issue. Thanks very much.
Try below formula
=SUBSTITUTE(PROPER(SUBSTITUTE(A1,"_"," "))," ","")
Use PROPER to capitalise, and SUBSTITUTE to remove the _'s
=SUBSTITUTE(PROPER(A1),"_","")
There are 2 ways towards the solution of this problem :
Using the replace function (built-in)
Using substitute formula
Example: =SUBSTITUTE(ORIGINAL_STRING,"OLD_CHARACTER","NEW_CHARACTER")
In this case =SUBSTITUTE(TRSP_INV_CD,"_","")
For more information on this consider visiting this here

How to substring in Excel between different characters?

first-time poster so please bear with me. I am trying to convince Excel to do a substring and failing miserably. The task is simple enough on the surface of it, extract text that's between a fixed set of chars (+, -, * and /), basically mathematical operators.
My input string looks like this:
A+B+C+D
Now, if my string looks like that, or like A-B-C-D, all is good, I can use this and it works (not my code, found on https://exceljet.net/formula/split-text-with-delimiter and modified to suit my needs:
First text: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),0*LEN($A2)+1,LEN($A2)))
Second: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),1*LEN($A2)+1,LEN($A2)))
Third: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),2*LEN($A2)+1,LEN($A2)))
Forth: TRIM(MID(SUBSTITUTE($A2,"+",REPT(" ",LEN($A2))),3*LEN($A2)+1,LEN($A2)))
And all is good, until I have a string like: A-B+C-D or wahtever combo, basically not all the same char.
I tried using Find and Search in different configurations, but I always come to the same problem:
Using substitute gives me the n'th occurance and that's no good as - may be my second symbol or third
Can't dynamically and accurately calculate the length for MID, as it does Nr. of chars, not "until"
I can't use VB script for security reasons, so I am stuck trying to use Excel formulas.
It HAS to be one formula, as in the end, it's part of a bigger formula that's something like this:
CONCATENATE(IF(ISNUMBER(A),A,VLOOKUP(A)),IF(ISNUMBER(A),A,VLOOKUP(A)),IF(ISNUMBER(A),A,VLOOKUP(A)),IF(ISNUMBER(A),A,VLOOKUP(A)))
So I have the input in a cell and my result has to do all the processing in an adjacent cell.
Thank you in advance, at whit's end over here.
You can try FILTERXML() function.
=TRANSPOSE(FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"+","|"),"-","|"),"*","|"),"/","|"),"|","</s><s>")&"</s></t>","//s"))
If you are not on Excel365 then try below formula.
=FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A1,"+","|"),"-","|"),"*","|"),"/","|"),"|","</s><s>")&"</s></t>","//s[" & COLUMN(A1) &"]")
To learn FILTERXML() go through this article from #JvdV
For lower versions of Excel following formula would work by copying across as much as needed:
=TRIM(MID(SUBSTITUTE(" "&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A1,"+"," "),"-"," "),"/"," "),"*"," ")," ",REPT(" ",99)),99*COLUMNS($A1:A1),99))
which is fairly similar to what has been posted on Exceljet site.

How should I grab data 3 values in and the codes at the end?

I need to create Value IDs from text data that isn't always the most helpful. My company is using Excel and SQL currently.
I have "BTA Canvas Taupe (#5461-0000)" and I need to create formulas to have "A.5461-0000". Currently I have this:
=CONCAT(MID(A6,3,1),".",IF(TRIM(CLEAN(IFERROR(RIGHT(A6,LEN(A6)-SEARCH("#",A6)),A6)))="",A6,TRIM(CLEAN(IFERROR(RIGHT(A6,LEN(A6)-SEARCH("#",A6)),A6)))))
It returns A.5461-0000)
How to get that last ")" off?
Thank you P.B, The substitute was the answer! Here is it working:
=SUBSTITUTE(CONCAT(MID(A6,3,1),".",IF(TRIM(CLEAN(IFERROR(RIGHT(A6,LEN(A6)-SEARCH("#",A6)),A6)))="",A6,TRIM(CLEAN(IFERROR(RIGHT(A6,LEN(A6)-SEARCH("#",A6)),A6))))),")","")
Assuming:
your original text string always ends with )
your original text string is in cell A1
You can use a combination of &, MID, FIND, and LEN functions to work out the target string:
=MID(A1,3,1)&"."&MID(A1,FIND("#",A1)+1,LEN(RIGHT(A1,LEN(A1)-FIND("#",A1)))-1)
Here is an alternative solution using FILTERXML function to find the serial number:
=MID(A1,3,1)&"."&FILTERXML("<a><b>"&SUBSTITUTE(LEFT(A1,LEN(A1)-1),"#","</b><b>")&"</b></a>","a/b[2]")

Extract Parameter from URL Excel

does anybody has an excel formula for me which just gives me back the clickid parameter? Unfortunately this parameter is not always at the same position so I can't fix it with character count. It should always be between &clickid= and &
https://app.appsflyer.com/id770725904?pid=website_adwords&c=C_DEU_billig&tl_rf=https%3A%2F%2Fwww.google.com%2F&tl_nw=g&tl_mt=e&clickid=EAIaIQobChMIj5zchvqs4AIVQamaCh06NQlOEAAYASACEgJhRPD_BwE&af_keywords=billig+telefonieren+nach+iran&af_c_id=1597316081&af_adset_id=60710335432&af_ad_type=1t1&af_adset=Iran&af_ad_id=303032652682
Well for sure a regular expression will be able to find this, but a rather simple formula could do the trick aswell. For example:
=MID(A1,FIND("clickid=",A1)+8,FIND("&",A1,FIND("clickid=",A1)+8)-(FIND("clickid=",A1)+8))
This will work but someone may have a tidier option ...
=LEFT(SUBSTITUTE(MID(A1,FIND("clickid",A1),1000),"clickid=", ""),FIND("&",SUBSTITUTE(MID(A1,FIND("clickid",A1),1000),"clickid=", ""))-1)
Throw your URL into cell A1 and test it out.

Delete the string after the delimiter in excel

I have simple problem. I was analyzing some data and came up with this problem.
Below is my value in a colomn:
www.mysite.come/api/Customer?id=12333&name=jack
www.mysite.come/api/Department?id=52365&name=COP
www.mysite.come/api/Customer?id=13333&name=mathew
etc
I want to filter this data something like this
www.mysite.come/api/Customer
www.mysite.come/api/Department
www.mysite.come/api/Customer
Please help me with this.
If its just as simple as removing everything after, including, the ? then this will do it:
=LEFT(A:A,FIND("?", A1)-1)
Edit: If you want to catch the #VALUE! error when there is no ? simply use IFERROR:
=IFERROR(LEFT(A:A,FIND("?", A1)-1), A1)
Example rows:
www.mysite.come/api/Customer?id=12333&name=jack
www.mysite.come/api/Department?id=52365&name=COP
www.mysite.come/api/Customer?id=13333&name=mathew
Output:
www.mysite.come/api/Customer
www.mysite.come/api/Department
www.mysite.come/api/Customer
I think you need to use a combination of FIND and LEFT.
For example (where A1 contains your original value)
=LEFT(A1, FIND("?", A1) -1)
The significance of your mention of filter is not clear to me but you might copy your data into another column, select the latter column and with Find/Replace Find what:
~?*
Replace All.
Its a good idea to handle when when the column doesn't contain the "?". To do this use the ISERROR() function as follows:
=LEFT(A2, IF(ISERROR(FIND("?",A2))=TRUE,LEN(A2), (FIND("?",A2)-1)))

Resources