Hi everyone,
I have somewhat of an issue figuring out a method to script this in excel. I have an excel document that contains a couple bits of information, and I need to sort it with logic in a specific manner. A single cell contains numerous values seperated by a ", " (comma followed by space). The output format must also stay using a single cell for multiple values for the script to be useful.
I want to organize the info in the Ref Des column of Chart 1 according to the data on Chart 2. It will also then tally up the total number of values in each of those formatted cells and display the total number of individual values in that cell.
Chart 1:
Known Data on Sheet 1 of Excell Document 1 (logic not applied to far 4 columns)[TABLE="class: grid, width: 700"]
<tbody>[TR]
[TD="align: center"]Line Item #
[/TD]
[TD="align: center"]Ref Des
[/TD]
[TD="align: center"]Ref Des T
[/TD]
[TD="align: center"]QTY on T
[/TD]
[TD="align: center"]Ref Des B
[/TD]
[TD="align: center"]QTY on B
[/TD]
[TD="align: center"]Total QTY
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]R100, R102, R104, R105
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]U1, U2, U13
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]3
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]C3, C105, C225, L24
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]4
[/TD]
[/TR]
</tbody>[/TABLE]
Chart 2:
Known Data on Sheet 2 of Excell Document 1[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD="align: center"]Ref Des
[/TD]
[TD="align: center"]T or B
[/TD]
[/TR]
[TR]
[TD="align: center"]R100
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]R102
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]R104
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]R105
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]U1
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]U2
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]U13
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]C3
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]C105
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]C225
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]L24
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
</tbody>[/TABLE]
Chart 3:
Desired Output Format from using script or logic on Sheet 1/Sheet 2 next to known data from above. The italicized headings are for reference. The italicized and bolded values are the desired outputs I should get from a successful script.[TABLE="class: grid, width: 1100"]
<tbody>[TR]
[TD="align: center"]Known Above
[/TD]
[TD="align: center"]Known Above
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Known Above
[/TD]
[/TR]
[TR]
[TD="align: center"]Line Item #
[/TD]
[TD="align: center"]Ref Des
[/TD]
[TD="align: center"]Ref Des T
[/TD]
[TD="align: center"]QTY on T
[/TD]
[TD="align: center"]Ref Des B
[/TD]
[TD="align: center"]QTY on B
[/TD]
[TD="align: center"]Total QTY
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]R100, R102, R104, R105
[/TD]
[TD="align: center"]R100
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]R102, R104, R105
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]U1, U2, U13
[/TD]
[TD="align: center"]U1, U2
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]U13
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]3
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]C3, C105, C225, L24
[/TD]
[TD="align: center"]C3, C105
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]C225, L24
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
</tbody>[/TABLE]
We currently have a script that can do this, but it has some limitations and is not imbedded inside excel. I want to be able to undersatnd how the script works as the values are not always seperated by just a ", " (comma followed by space) but also sometimes just a " " (space) or "," (comma with no space) etc. (documents do not mix seperation styles, they just use one or the other). The excel documents we are doing this to are much more complex than what I am showing here as this is a more simplistic view for asking the question. (The Ref Des cells can have 100's of values seperated by ","/" "/", " not just 3 or 4, and there can be 100's of line items, not just 3 or 4). However, the complexity of the data should not matter as the basic functionality of the script would be the same in my opinion.
If this is not possible in excel, please suggest or point me in the direction of some other methods I could look into to acheive this. Currently, seperating this by hand is extremely time consuming I thought about using VBScript to do this, but wanted to see if it was possible inside Excel first.
I tried to be as thorough as possible in explaining what I want to achieve, but as an engineer I can sometimes leave details out that might be needed to solve the problem. I will try to keep tabs on this thread from my phone to answer any questions that may arise.
Thank you.
I have somewhat of an issue figuring out a method to script this in excel. I have an excel document that contains a couple bits of information, and I need to sort it with logic in a specific manner. A single cell contains numerous values seperated by a ", " (comma followed by space). The output format must also stay using a single cell for multiple values for the script to be useful.
I want to organize the info in the Ref Des column of Chart 1 according to the data on Chart 2. It will also then tally up the total number of values in each of those formatted cells and display the total number of individual values in that cell.
Chart 1:
Known Data on Sheet 1 of Excell Document 1 (logic not applied to far 4 columns)[TABLE="class: grid, width: 700"]
<tbody>[TR]
[TD="align: center"]Line Item #
[/TD]
[TD="align: center"]Ref Des
[/TD]
[TD="align: center"]Ref Des T
[/TD]
[TD="align: center"]QTY on T
[/TD]
[TD="align: center"]Ref Des B
[/TD]
[TD="align: center"]QTY on B
[/TD]
[TD="align: center"]Total QTY
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]R100, R102, R104, R105
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]U1, U2, U13
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]3
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]C3, C105, C225, L24
[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]4
[/TD]
[/TR]
</tbody>[/TABLE]
Chart 2:
Known Data on Sheet 2 of Excell Document 1[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD="align: center"]Ref Des
[/TD]
[TD="align: center"]T or B
[/TD]
[/TR]
[TR]
[TD="align: center"]R100
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]R102
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]R104
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]R105
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]U1
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]U2
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]U13
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]C3
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]C105
[/TD]
[TD="align: center"]TOP
[/TD]
[/TR]
[TR]
[TD="align: center"]C225
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
[TR]
[TD="align: center"]L24
[/TD]
[TD="align: center"]BOTTOM
[/TD]
[/TR]
</tbody>[/TABLE]
Chart 3:
Desired Output Format from using script or logic on Sheet 1/Sheet 2 next to known data from above. The italicized headings are for reference. The italicized and bolded values are the desired outputs I should get from a successful script.[TABLE="class: grid, width: 1100"]
<tbody>[TR]
[TD="align: center"]Known Above
[/TD]
[TD="align: center"]Known Above
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Applied Logic Column
[/TD]
[TD="align: center"]Known Above
[/TD]
[/TR]
[TR]
[TD="align: center"]Line Item #
[/TD]
[TD="align: center"]Ref Des
[/TD]
[TD="align: center"]Ref Des T
[/TD]
[TD="align: center"]QTY on T
[/TD]
[TD="align: center"]Ref Des B
[/TD]
[TD="align: center"]QTY on B
[/TD]
[TD="align: center"]Total QTY
[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]R100, R102, R104, R105
[/TD]
[TD="align: center"]R100
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]R102, R104, R105
[/TD]
[TD="align: center"]3
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
[TR]
[TD="align: center"]2
[/TD]
[TD="align: center"]U1, U2, U13
[/TD]
[TD="align: center"]U1, U2
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]U13
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]3
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]C3, C105, C225, L24
[/TD]
[TD="align: center"]C3, C105
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]C225, L24
[/TD]
[TD="align: center"]2
[/TD]
[TD="align: center"]4
[/TD]
[/TR]
</tbody>[/TABLE]
We currently have a script that can do this, but it has some limitations and is not imbedded inside excel. I want to be able to undersatnd how the script works as the values are not always seperated by just a ", " (comma followed by space) but also sometimes just a " " (space) or "," (comma with no space) etc. (documents do not mix seperation styles, they just use one or the other). The excel documents we are doing this to are much more complex than what I am showing here as this is a more simplistic view for asking the question. (The Ref Des cells can have 100's of values seperated by ","/" "/", " not just 3 or 4, and there can be 100's of line items, not just 3 or 4). However, the complexity of the data should not matter as the basic functionality of the script would be the same in my opinion.
If this is not possible in excel, please suggest or point me in the direction of some other methods I could look into to acheive this. Currently, seperating this by hand is extremely time consuming I thought about using VBScript to do this, but wanted to see if it was possible inside Excel first.
I tried to be as thorough as possible in explaining what I want to achieve, but as an engineer I can sometimes leave details out that might be needed to solve the problem. I will try to keep tabs on this thread from my phone to answer any questions that may arise.
Thank you.