I have data in the following format. The values are in one column. I need to transpose them keeping the delimiter. I tried replacing the values using regular expression '\r\n' but it does nothing.
653
|110
|1 January 2016
|Default
|Automatically identified, customer dialed
|None
|NPA dialed by customer
|000-380-5414
|03:59:57.5
|4:01.9
|CIC = 0000 |1 January 2016
|03:59:35.5
|4:23.9
|10
|SS7 from IC to AT, SS7 to EO |Tandem
|104
|Routing Indicator = Direct - Incoming Different network |104
|Routing Indicator = Direct - Outgoing Different network |119
|Trunk Group Number - Interoffice = 9056 |Network Interface Description = Feature Group D
|Administrative Domain = 0 |Final module
|
625
|119
|1 January 2016
|Default
|Automatically identified, customer dialed
|None
|000-000-0000
|NPA dialed by customer
|000-380-5084
|04:04:26.6
|0:00.0
|CIC = 0000 |1 January 2016
|04:04:24.6
|0:01.9
|01
|SS7 from IC to AT, SS7 to EO |Tandem
|CAC not dialed, station not presub, no presub ind
|Neither ANI nor CPN provided
|104
|Routing Indicator = Direct - Incoming Different network |104
|Routing Indicator = Direct - Outgoing Different network |119
|Trunk Group Number - Interoffice = 9056 |Network Interface Description = Feature Group D
|Administrative Domain = 0 |Final module
|
How do i convert this to the following structure
653|110|1 January 2016|Default|...
652|119|1 January 2016|Default|...
I have textpad and notepad++. Any assistance is much appreciated...
Find what: \r\n\|
Replace with: \|
You could do:
Ctrl+H
Find what: \R\|
Replace with: |
Replace all
Explanation:
\R : any kind of line break
\| : pipe character
Related
I have a spreadsheet with over 6500 rows displaying a list of chemicals and their relationships in the following format:
Chemical | 1,1,2-Trichloro-1,2,2-trifluoroethane :- {FREON TC} | FREON TC
Chemical | 1,1,2-Trichloro-1,2,2-trifluoroethane :- {FREON TC} | ug/l
Chemical | 1,1,2-Trichloro-1,2,2-trifluoroethane :- {FREON TC} | mg/l
I want to transform this all into one row e.g.
Chemical | 1,1,2-Trichloro-1,2,2-trifluoroethane :- {FREON TC} | FREON TC | ug/l | mg/l
This is just an extract of this spreadsheet and there are many chemicals. Any advice much appreciated. This is an exported spreadsheet from an Access database so if there is an Access query that can help I'm all ears.
Have found an answer using power query in Excel, required only some minor changes (delimiter character) but worked perfectly:
https://www.mrexcel.com/forum/power-bi/1063813-convert-2nd-column-values-rows-when-column-1-same-name.html
I want to return a label(s) based on an intersection of a Row and Column equal to "Yes".
| Location |
ID | Tool | Wall | Bin | Toolbox | Count
---+--------+------+-----+---------+-------
1. | Axe | YES | | | 1
2. | Hammer | | | YES | 5
3. | Pliers | | | YES | 2
4. | Nails | | YES | | 500
5. | Hoe | YES | | | 2
6. | Screws | | YES | | 200
7. | Saw | YES | | | 3
What's in Toolbox? (Results wanted)
Axe,Wall, 1
Hammer, Toolbox, 5
Pliers,Toolbox, 2
Nails,Bin, 500
Hoe, Wall, 2
Screws, Bin, 200
Saw, Wall, 3
I also want to be able add Tools and Locations?
Without using VBA, this is going to be a bit of a pain, but workable if you don't mind helper columns. I don't advise trying to do this in a single Array Formula, because text strings are hard to work with in Array formulas. That is - if you have an array of numbers, you can turn that into a single result a lot of ways (MIN, MAX, AVERAGE, SUM, etc.). However with an array of strings, it's harder to work with. Particularly, there's no easy way to concatenate an array of strings.
So instead, use a helper column. Assume column A = toolname, column B = a check for being on the wall, column C = a check for being in the bin, column D for being in the toolbox, and column E for the number available.
FORMATTING SIDE NOTE
First, I will say that I recommend you use TRUE/FALSE instead of "yes"/"no". This is because it is easier to use TRUE / FALSE within Excel formulas. For example, if you want to add A1 + A2 when A3 = "yes", you can do so like this:
=IF(A3="yes",A1+A2)
But if you want to check whether A3 = TRUE, this is simplified:
=IF(A3,A1+A2)
Here, we didn't need to hardcode "yes", because A3 itself will either be TRUE or FALSE. Also consider if you want to make a cell "yes" if A3 > 5, and otherwise be "no". You could do it like this:
=IF(A3>5,"yes","no)
Or, if you used TRUE/FALSE, you could simply use:
=A3>5
However, I'll assume that you keep the formatting you currently have (I would also recommend you just have a single cell that says either "toolbox"/"bin" etc., instead of 4 columns where 1 says "yes", but we'll also assume that this needs to be this way).
BACK TO YOUR QUESTION
Put this in column F, in F2 for the first cell:
=Concatenate(A2," ",INDEX($B$1:$D$1,MATCH("yes",B2:D2,0))," ",E2)
Concatenate combines strings of text into a new single text string. You could also use &; like: A2 & " " etc., but with this many terms, this is likely easier to read. Index looks at your header row 1, and returns the item from the first column which matches "yes" in the current row.
Then put the following in F3 and drag down:
=Concatenate(F2," ", A2," ",INDEX($B$1:$D$1,MATCH("yes",B2:D2,0))," ",E2)
This puts a space in between the line above and the current line. If instead you want to make each row appear after a line-break, use this:
=Concatenate(F2,CHAR(10), A2," ",INDEX($B$1:$D$1,MATCH("yes",B2:D2,0))," ",E2)
I have a data set as follows:
A | B | C |...
1abc | 1def | 1ghi |...
2abc | 2def | 2ghi |...
...
This is a collection of memo notes for each account in our database. The 1 in "1abc" represents the account ID and the letters represent some text. There are a total of 177 columns and 1866 rows but not every row has values up to column 177, some may only have two columns worth of data.
I need each column to drop down to the bottom of column A so that all data only occupies Column A. For example, all the data in column B would inserted after the last value in A. Data in column C would be inserted after the last value in column A after it's been populated with the data from B and so on.
In the end, it should look something like this (from which point I can simply sort it in ascending order).
A | B | C |
1abc | | |
2abc | | |
...
1def | | |
2def | | |
...
1ghi | | |
2ghi | | |
...
Can anyone help out with this? I am assuming that I need a macro and have tried working with the solution found in this post but couldn't figure it out. Oh, and I'm using Excel 2003 if that helps.
I am not sure if this will help but, from what you have given me, it sounds like you have 3 columns of data that you would like to be put into one column. If I am correct in my thinking, you can do this a few different ways. So as to preserve the original document in its entirety while adding an extended sorting system you could: 1: Create new tab. Then highlight range a with your mouse. Using your mouse right click and select copy (try to keep in mind the value of the range, E.g. How many items have you copied. Paste it in your now tab. Do this for the remaining ranges. Or maybe use V look up. If you would like I have a schedule module I have created that has many different types of range associations. You can also split sting in excel to divide the id from the sting.
Without VBA, add a blank row at the top and a column on the left populated throughout with say x and then follow the steps detailed here. Then delete the left-hand two columns and filter the remaining one to remove any blanks.
Help!
I enjoy Excel but I wanted to see if this were an option. I might even consider coding this in a simple javascript or so file.
I am trying to make a code that can be copied and dragged down on each new file that is made from our server.
On the file, there are NPA's and NXX's. If you aren't sure what that is, it is the area code and prefix. Like 555-111-2222. 555 is the NPA and the 111 is the NXX.
Well, I would like to create an IF statement that capture the various NPA and NXXs combinations and what their carrier is for our markets.
For example, 479-203 is Centurylink. However, 479 is in column N and 203 is in column O.
While I can create, if N2 = "479" and O2 = "203", CenturyLink, --- do another if statement.
I was not sure since I have another excel document that does not change with the values present if I could use that to help answer the question.
In columns A and B on another document have the NPA and NXXs. In the same file, column L has the carrier name.
Is there a search capability that I can use for this? If you name the function, I'll look it up too. I'm not picky. :)
Edit:
=IF(OR(N10="479",N10="870"),VLOOKUP(CONCATENATE(N10,"-",O10),[TnList.xls]AR!$A:$D,4,FALSE),VLOOKUP(CONCATENATE(N10,"-",O10),[TnList.xls]KS!$A:$D,4,FALSE))
You will need to add another column to the left of the data in your carrier spreadsheet and fill it with =CONCATENATE(B2,"-",C2) first:
CarrierSpreadsheet.xls:
NPA-NXX | NPA | NXX | Carrier
429-203 | 429 | 203 | CentryLink
123-111 | 123 | 111 | CarrierA
456-222 | 456 | 222 | CarrierB
789-333 | 789 | 333 | CarrierC
Then add 2 columns to your phone number data determine the carrier from your phone number spreadsheet. Column B needs to be filled with =LEFT(C2,7) and column A needs to be filled with =VLOOKUP(B2,[CarrierSpreadsheet.xls]Sheet1!$A:$D,4,FALSE):
PhoneNumbers.xls
Carrier | NPA-NXX | Number
CentryLink | 429-203 | 429-203-9999
CentryLink | 429-203 | 429-203-8888
CarrierB | 456-222 | 456-222-9999
CarrierC | 789-333 | 789-333-9999
Let me know if you have any questions.
PS - If this answer works for you please click the grey checkmark to the upper left corner or my answer.
You can use a LOOKUP formula which avoids adding extra columns, e.g.
=LOOKUP(2,1/(Data!A$2:A$100=N2)/(Data!B$2:B$100=O2),Data!L$2:L$100)
That assumes Data worksheet is your "other file"
You could name the columns; then the formula can simply refer to the names. But you'd have to name the relevant columns in each document; I'm not sure how well that would work for you.
Is there a method whereby columns in Excel (2003, 2007 and/or 2010) can be automatically shown (un-hidden) when the column to the left contains data?
Something like this:
IF column to the left contains data
THEN show column
+-----+-----+
| C | C | //If column1 contains data
| O | O | //Then reveal/show (unhide) column2
| L | L |
| U | U |
| M | M |
| N | N |
| 1 | 2 |
+-----+-----+
I'm guessing that VB code is required but am unsure as to what this would be.
Further to this, is there a way to automatically show the column going by the date (first day of each month)? This is a little more complicated. For example:
FOR all dates
IF system date = year(month.day1) //If it is the first day of a new month
THEN show column(month) //Then show the corresponding column for that month
ENDIF
ENDFOR
i.e. IF system date = 01/09/2012
THEN show column(September)
Is this possible?
Thank you.
Correct, you need VBA to achieve that. Use the Worksheet_Change event which fires whenever something changes. Then, use one of the various methods to determine if a column is not empty (http://ewbi.blogs.com/develops/2006/03/determine_if_a_.html, or just google). Alternatively, if this is to slow because if fires almost all the time, you could use the Worksheet_Activate() event (an overview of all Excel events can be found here).
If your column 7 contains data, you can unhide column 8 using MyWorksheet.Columns("8:8").Hidden = False.
Your second problem can be solved in a similar way. In the Worksheet_Activate(), check if today is the first day in a month using Day(Date) = 1 (I guess it needs to take into account that the user may not be using Excel this day, so the code should be a little more complex) and show that column using MyWorksheet.Columns("12:12").Hidden = False (or whichever it is) for December 1st.
All this code assumes that the columns are already there, just hidden.