Remove Characters from a Cell in Excel - excel-formula

I need to get only values after '=' sign i.e.
Original:
aad.eaadDetails = e-AD Details
Result:
e-AD Details
Please help me in dealing with it as their are 1000s of such values/data which needs to be processed.

Enter into cell A1 the following string:
aad.eaadDetails = e-AD Details
Enter into cell B1 the following formula:
=RIGHT(A1, LEN(A1) - FIND("=",A1))
Output in B1:
e-AD Details
Assuming you enter all your data into the A column, you can simply copy the formula in B1 down all the way to achieve what you want. Note that this formula extracts everything after the =, which may include whitespace. I also assume that there is only one = sign in each string.

Related

How to extract numbers with separation in Excel

Does anyone knows any formula to extract the number with separation (dot, comma) from cell A1 to cell B1?
Example, I want to extract 2,590.00 from cell A1 which has the following value:
[sum: 2,590.00]
I got the formula below that works nice, however is just getting all numbers e.g. 259000
{=TEXTJOIN("",TRUE,IFERROR((MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)*1),""))}
I appreciate every support
Under O365 you can try the following in cell B1 which is a very concise approach:
=TEXTAFTER(TEXTBEFORE(A1,"]"), "sum: ")
Here is the output:
For excel-2019, similar idea but using SUBSTITUTE instead to remove the prefix ([sum: ) and the suffix (]):
=SUBSTITUTE(SUBSTITUTE(A1,"[sum: ",""),"]","")
You can use a formula like as below:
• Formula used in cell B1
=MAX(IFERROR(--MID(SUBSTITUTE(A1,"]",""),ROW($ZZ1:INDEX($ZZ:$ZZ,LEN(A1))),LEN(A1)),0))
• With OFFICE 365, you can try this in cell C1
=--INDEX(TEXTSPLIT(A1,{":","[","]"},,1),,2)
• Formula used in cell D1
=SUBSTITUTE(TEXTAFTER(A1," "),"]","")*1

How to use comma separated values in a cell, as parameters in formula (PivotTable specifically)?

I have a formula that pulls data from PivotTable and sums up according to ID:
=SUM(GETPIVOTDATA("Value",$A$3,"AccounID",{5637855, 6839652, 5839670}))
I would like to use the same formula but with a reference:
=SUM(GETPIVOTDATA("Value",$A$3,"AccounID",A1))
When A1 is: 5637855, 6839652, 5839670.
In this case if there is one ID or 10 IDs - it will be the same formula and I can only add an ID in the cell A1.
I am sure that it is possible somehow with Macro, but I want a simple way (since macros in my company are restricted).
I found a few workarounds with SUMPRODUCT and range of cells, but this solution is not practical in my case.
Use this array formula
=SUM(IFERROR(GETPIVOTDATA("Value",$A$3,"AccounID",TRIM(MID(SUBSTITUTE($A$1,",",REPT(" ",99)),(ROW($A$1:INDEX(A:A,LEN($A$1)-LEN(SUBSTITUTE($A$1,",",""))+1))-1)*99+1,99))),0))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
All the A1 refer to the cell in which the string is found, EXCEPT the first one in the ROW argument. Leave that as A1 change all the others to the cell in which the string can be found.
Try this:
Option2:
if someone doesn't have the cell A1 restriction`
Create a table (use format as table) with the IDs you want to sum:
[criteria]
| 5637855|
| 6839652|
| 5839670|
Then replace in your formula with the range from your table criteria like:
=SUM(GETPIVOTDATA("Value",$D$1,"AccounID",Table1[criteria]))
and activate the formula as an array with Ctrl+Alt+Enter or Ctrl+Shift+Enter depending your Excel version.
If you highlight Table1[criteria] in the formula and press F9 you will see that the value it is getting is {5637855, 6839652, 5839670}.

Excel - breaking up a cell

I have part numbers with dashs and numbers for organization purpose, and I was wondering if there's a way I could de-concatenate the string into nearby cells with a formula or two and not go through Data > Text to Columns. Any idea?
Here's a demo of a formula-based approach. The formulas will work in Excel.
https://docs.google.com/spreadsheets/d/1LXtKOsxzo1J2-D1e4e_QUqxUug191GHJ5exWSWcoS0s/edit?usp=sharing
It works like this:
A1 contains the string you want to break up, say 12424-22778-3432626-442-52523262.
B2 contains this formula: =FIND("-",$A1,1). This will find us the first occurrence of - in A1.
B3 contains this formula: =FIND("-",$A1,B1+1). This will find us the next occurrence of - in A1 (it starts looking for - from the position following what we found in B2.
B4... can be copied over from B3. If you copy the cell rather than the formula, the formula will automatically change the reference to B1 to C1 and up. In the example, it's copied over all the way to E1.
F1 contains =mid($A1,1,B1-1). This gets us the string from the first char to the B1-1th char, i.e.: start to first occurrence of -, but without the -.
G1 contains =mid($A1,B1+1,C1-B1-1). You can copy this over up to the second to last cell. The gets us the string from the previous - (+1, i.e. without the -) to the next - (-1, i.e. without the -).
J1 is the last cell and contains =mid($A1,$E1+1,len($A1)). It works the same as the previous formula, but goes up to the end of the string in A1.

How to add white spaces in a field of Excel which is equal to length of a longer word

I have a scenario where I want my Microsoft excel field to have the same length of the longest word in the column.
Basically lets say if I have:
ACBBASDBBADSAD
BADFDFDDF
So here I want to have the second word with less characters to have white spaces at its end to match the length of the first word.
=&" " this definitely helps but I am unable to achieve the above scenario
Consider this screenshot:
In column B the length of each cell of column A is established with the formula =len(A1) copied down.
Cell D2 has the range name MaximumLength and the formula =max(B:B).
With that in place, you can create the padded values with this formula in cell G1, copied down:
=A1&REPT("*",MaximumLength-LEN(A1))
If you don't want to use the helper column and helper cell, you can use this array formula instead:
=A2&REPT("*",MAX(LEN(A1:A15))-LEN(A2))
This formula must be confirmed with Ctrl-Shift-Enter. It is advisable to use defined ranges, not whole columns in array formulas, hence the range in LEN(A1:A15). Adjust as desired.
I've used the "*" character so it is visible. Replace it with a space " " in your scenario.
You can add this formula to count maximum characters and use on some cell, because you will need to press a command for it to work, so every cell can't contain this formula, let's say it is on Z1:
=MAX(LEN($A:$A))
Certify to press ctrl+shift+enter on the formula
Then you use this formula on your cells:=REPT(" ";Z1-LEN(A2))&A2
Edit: Sorry, anwsered late, teylyn is more complete.

Excel lookup special character

I am looking up cell C2 in range A1:B9 and returning the value from 2nd column.
The cell value can be text or text and special characters eg. CL,CL*,C-L etc.
The range has space in front or after the characters so I guess trim required.
I used the below formula which include "~"& before and after C2 to let excel read the special character as they are. However it is not working as I expected. Can anyone point out the issue and solution?
=VLOOKUP("~"&C2&"~",TRIM($A$1:$B$9),2,FALSE)
i.e.
I am looking up Cl* (C2) and the range of lookup is like below, I expect the formula to return Cl* but it returns ClG:
ClG ClG
Cl*? C?*
GlCl? Gl?
Cl* Cl*
GlCl GlC
CataclyV* CV*
Cloud Cld
*inCl *iC
GinCl GiC
Try this one:
=VLOOKUP(SUBSTITUTE(SUBSTITUTE(C2,"?","~?"),"*","~*"),TRIM($A$1:$B$9),2,0)
and press CTRL+SHIFT+ENTER to evaluate it
UPDATE:
similar to another answer, you can use this one without array enrty (returns last appearence of cell C2 in range A1:A9):
=LOOKUP(2,1/(TRIM(A1:A9)=C2),B1:B9)
You can try this array formula:
=INDEX(B1:B9;MATCH(1;FIND(C2;TRIM(A1:A9));0))
You need Ctrl Shift Enter to enter the formula
Depending on your regional settings you may need to replace ";" by ","
Yes you are right replace by:
=INDEX(B1:B9;MATCH(1;1*(C2=TRIM(A1:A9));0))

Resources