Good morning, I was looking for a formula to help me with this in Excel 2016, but I did not succeed, I have this text in a cell:
CF|0101|2019-02-05|01|F007-00000018|PEN|20539043782|6|20479636304|SERVICENTRO SANTA MARIA EIRL|CARRET. JAEN SAN IGNACIO KM 25- CAS. YANUYACU- JAEN||||||||6.10|33.90|6.10|0.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00|0.00|33.90|40.00|0.00|0.00|40.00|1000|CUARENTA CON 00/100 SOLES |||||||M5K-788|
I want to extract the text with the help of the separator "|" and in a not so long formula, try with FIND, but the formula becomes very long after the third linked search, is there any way to obtain the position of the separator by number of concurrency? , something like this:
Searched text;Cell;Repetition number(concurrency of simbol)
=FORMULA("|";A1;2)
Result: 8
Or simulate something like this?
From already thank you very much.
**UPDATE
I will not use all the texts among the "|", that's why my need to obtain the position of the separators to extract only the text I need, since the tool "Text to Columns "forces you to give a position for all the separate texts.
If you truly want a formula that will separate everything into unique Columns. Then perhaps you should look at a custom formula. Here is a quick example of UDF that can parse data based on the "|"
Function SplitData(rng As String, Character As Variant, Position As Integer) As Variant
SplitData = Split(rng, Character)(Position - 1)
End Function
Once this function has been placed into a VBA module, then you can call this from any cell within that workbook.
To keep things simple here is the breakout...
=SplitData( <THE CELL THAT CONTAINS THE DATA YOU WISH TO PARSE>, <THE CHARACTER YOU WANT TO USE AS YOUR DELIMITER>, <POSITION IN WHICH YOU WANT TO DISPLAY THE TEXT (Valid Numbers start at 1+> )
The POSITION Point is used to display which section of the text. For example based on your example provided, if you populated the following...
=SplitData(A1, "|", 1) == "CF"
By the way, if you are dead set on finding the location of the "|", then how about using the =Search() formula. This will easily hunt do the character position of the first "|", but with a little bit of work you can get it to display other locations.
As outlined here, you can use Text to Columns:
Select the cell or column that contains the text you want to split.
Select Data > Text to Columns.
In the Convert Text to Columns Wizard, select Delimited > Next.
Select the Delimiters for your data. You'd want to put a | in the "Other" area.
Select Next.
Select the Column data format or use what Excel chose for you.
Select the Destination, which is where you want the split data to
appear on your worksheet.
Select Finish.
Or - if you literally just need all that in a single string, without |, you can use SUBSTITUTE():
=SUBSTITUTE(A1,"|"," ")
I need to embrace all my cells content with { } for a tool I would like to use.
How can I do this?
Note that the content is not a number, but a string instead
Try:
="{" & A1 & "}"
And then dragging down to perform the formula on all of the cells you need.
You can then Copy those values and then Paste Special -> Paste as Values to get the actual text, rather than the formula.
The easiest way would be to copy the data to a new column or row (or even new sheet) using a function such as:
=CONCATENATE("{", A1, "}")
i have two sheets raw Data and Summary. i need help in editing below formula which i am using in my VBA code. i am looking for sum of one particular id for multiple conditions. in summary unique ids and i already have this formula which is working fine
=SUMPRODUCT(('Raw Data'!$A$2:$A$3457=A2)*('Raw Data'!$D$2:$D$3457={"HAUD","AANZ","CSHK","HCNY","CHN1,CHN2","IN1","DBIN","CSJL","CTOK","BTK","K01","MYFM","MYPB","HNZD","BNZD","PKDB","HSBP","SCS","SCTW","SCT","SCT"})*('Raw Data'!$F$2:$F$3457="BLF")*('Raw Data'!$G$2:$G$3457))
sum in "G" column sholud also include cells in D column which begins with "TW" or "K"
i tried this but its not working
=SUMPRODUCT(('Raw Data'!$A$2:$A$3457=A2)*(LEFT('Raw Data'!$D$2:$D$3457,2)="TW"))*(LEFT('Raw Data'!$D$2:$D$3457,2)="K"))*('Raw Data'!$D$2:$D$3457={"HAUD","AANZ","CSHK","HCNY","CHN1, CHN2","IN1","DBIN","CSJL","CTOK","BTK","K01","MYFM","MYPB","HNZD","BNZD","PKDB","HSBP","SCS","SCTW","SCT","SCT"})*('Raw Data'!$F$2:$F$3457="BLF")*('Raw Data'!$G$2:$G$3457)
your assistance highly appreciated
below one is also tried it shows blank all "," are replaced with * still shows Blank
=SUMPRODUCT('Raw Data'!$G$2:$G$3457,--('Raw Data'!$A$2:$A$3457=A2),(LEFT('Raw Data'!$D$2:$D$3457,2)="TW")+(LEFT('Raw Data'!$D$2:$D$3457,1)="K"),--ISNUMBER(MATCH('Raw Data'!$D$2:$D$3457,{"HAUD","AANZ","CSHK","HCNY","CHN1","CHN2","IN1","DBIN","CSJL","CTOK","BTK","K01","MYFM","MYPB","HNZD","BNZD","PKDB","HSBP","SCS","SCTW","SCT","SCT"},0)),--('Raw Data'!$F$2:$F$3457="BLF"))
I believe that the first formula should be more like:
=SUMPRODUCT(('Raw Data'!$A$2:$A$3457=A2)*('Raw Data'!$D$2:$D$3457={"HAUD","AANZ","CSHK","HCNY","CHN1","CHN2","IN1","DBIN","CSJL","CTOK","BTK","K01","MYFM","MYPB","HNZD","BNZD","PKDB","HSBP","SCS","SCTW","SCT","SCT"})*('Raw Data'!$F$2:$F$3457="BLF")*('Raw Data'!$G$2:$G$3457)*((LEFT('Raw Data'!$D$2:$D$3457,2)="TW")+(LEFT('Raw Data'!$D$2:$D$3457,1)="K")))
There was no quotes in "CHN1,CHN2" in both the first and the working formula that I added. I also changed
(LEFT('Raw Data'!$D$2:$D$3457,2)="TW"))*(LEFT('Raw Data'!$D$2:$D$3457,2)="K"))
to
((LEFT('Raw Data'!$D$2:$D$3457,2)="TW")+(LEFT('Raw Data'!$D$2:$D$3457,1)="K"))
The last one should work if you change the , in the array to ; (to mean a vertical array):
=SUMPRODUCT('Raw Data'!$G$2:$G$3457,--('Raw Data'!$A$2:$A$3457=A2),(LEFT('Raw Data'!$D$2:$D$3457,2)="TW")+(LEFT('Raw Data'!$D$2:$D$3457,1)="K"),--ISNUMBER(MATCH('Raw Data'!$D$2:$D$3457,{"HAUD";"AANZ";"CSHK";"HCNY";"CHN1";"CHN2";"IN1";"DBIN";"CSJL";"CTOK";"BTK";"K01";"MYFM";"MYPB";"HNZD";"BNZD";"PKDB";"HSBP";"SCS";"SCTW";"SCT";"SCT"},0)),--('Raw Data'!$F$2:$F$3457="BLF"))
I'm working on an Excel file and I need to seperate a long string divided by "|" into different strings
for example:
"AB100|AB101|AB102|AB103"
I need to seperate them into - AB100, AB101, AB102, AB103
Thank you!
From the Ribbon, under the 'Data' tab, select 'Text to Columns' and select the appropriate delimiter, in this case it is |
Illustrative screenshot on where to find it and the output:
Note I have done it with two copies of your example string to show a before and after. It will replace the original string in A1 with the values split across the columns.
With your data in A1, in B1 enter:
=TRIM(MID(SUBSTITUTE($A1,"|",REPT(" ",999)),COLUMNS($A:A)*999-998,999))
and copy across.
I am totally new to this kind of challenges and not sure any thing available ( not sure even on what base I have to search )
In the below excel sheet image the column 'A' has headings in two places ( row numbers 2,3 and 9,10) . The actual excel sheet has more than six thousand rows and too many sub headings like this ( If it is small file I can do it manually.. but more than 6 thousand rows)
The challenge :- I want to populate E column with "Make" value and F column with " Model" from sub headings . Can I write any rule or macro to populate these columns ? could some one help me ? Thanks for your help
Image Link
or below
Regards
Kiran
If you want to do this solely in Excel you can use the following. This assumes
All Headings are the same for "S.No"
Change the SUBSTITUTE clause to match the text for Make and Model eg I have used exact spacing of "Model: " and "Make : " to match the spreadsheet and substitute with ""
In cell G5 Enter =IF(ISNUMBER(A5),IF(ISERROR(FIND("Model",A3,1)),MAX($G$1:G4),MAX($G$1:G4)+1),"")
In cell F5 Enter =SUBSTITUTE(IF(ISNUMBER(A5),INDIRECT(ADDRESS(MATCH($G5,$G:$G,0)-2,COLUMN(A1),1)),""),"Model: ","")
In cell E5 Enter = =SUBSTITUTE(IF(ISNUMBER(A5),INDIRECT(ADDRESS(MATCH($G5,$G:$G,0)-3,COLUMN(A1),1)),""),"Make : ","")
Then drag down the formula in E5:G5 to wherever you need. However, I only recommend using this once only as the formulae will be slow to update over large ranges. Also if your headings are out of sync then VBA is the way forward