How to tidy up postal addresses in an excel sheet? - excel

I'm using a spreadsheet to process information on people as it comes in, including names, addresses, etc.
The way we receive the addresses allows for them to come in very messily and the addresses themselves vary so much. We also have Eircodes which are seven digits but provide further issues as some people put them in as "XXX XXXX" and others "XXXXXXX" and some only put in half the Eircode to begin with. All this information appears in a single cell with no commas to separate anything.
The addresses come in all over the place, examples would include:
12 Example Street Made Up Area Co. Dublin Dublin Dublin 22 D220000
12 Example Street Made Up Area Dublin D 22
12 Example Street Made Up Area Made Up Area Dublin D220000
I want to make them look roughly like this:
12 Example Street Made Up Area Dublin
The County name is different across the addresses but is always included and is always one of the 26 Counties in ROI.
Can anyone help me with a VBA code for this please? I have a few VBAs to sort out other information and I've combined them all to a Master command and a single button on the main page, so I'd like to add it to that.
P.S. I'm having a similar issue with phone number prefixes so I'm hoping the logic here will apply there too.

Related

Need help organizing text in Python 3

First time here, I need help organizing an inputted text file in Python
The text file contains basketball team names, their conference, and wins/losses
Example:
Miami (FL) (Atlantic Coast) 32 5
UCLA (Pac-12) 32 5
Fresno St. (Western Athletic) 25 8
I need these created into objects of:
team_name
conf
wins
losses
My problem is the diverse format these come in, for instance, Miami (FL) is a name, some names contain two strings, others contain one. Some conferences contain one string or two, and in the Miami example, the name contains parenthesis. I can't figure out any good way to sort these because they're all so different. Any help would be amazing, thanks!

Waterfalls in Excel

UPDATE I tried to upload pictures, but I got the message that I couldn't upload pictures but I got links instead. Let me know if this works...
Thanks for taking a second to look through this. This is my first post so I am trying to make sure that I make the question (and hopefully, the solution) relevant to more than just me.
I work in a repair/manufacturing planning position and have to identify the bottlenecks in my various processes. I have one type of asset that has multiple flavors. For example, if I worked on Honda Accords, I would have to distinguish between a 1986 Accord LX from a 1996 Accord EX-L.
Based on the induction schedule of my assets and how long they take in different parts of my processes, these bottlenecks can be manifest in several different ways: a lack of facility space, a lack of a certain type of manpower, or a lack of support equipment just to name a few. Now, I have dates for incoming assets for the next two years, and I have the durations for the different parts of my processes that each type of asset will. More simply: an Accord from 1986 takes 3 weeks to inspect (Gate 1), 4 weeks to repair (Gate 2) and 5 weeks to put back together and test (Gate 3); whereas an Accord from 1996 takes 3 weeks to inspect(Gate 1) 2 weeks to repair (Gate 2) and 3 weeks to put back together and test (Gate 3).
I have already been able to take the incoming dates an lay them out on our fiscal year (vs. the calendar year) using =weeknum(). I then used an =IF() to place an "x" on the corresponding week.
What I am looking to do is place a series of colored cells (corresponding to the weeks of the gates) that starts in the cell with the "x" and extends to the cells to the right the number of cells corresponding to the number of weeks. For example, if I have a 1986 Accord start in week 3, I would like the 3 cells to the right to be blue, followed by 4 green cells, and finally 5 yellow cells. I am essentially trying to graphically represent the times that the assets will be within my facilities and where my bottlenecks are. If I only have 5 locations for Gate 1 and my waterfall shows I have times where I need 8 spaces, I need to let the boss know.
I didn't see a way to upload the files I am working from, so if someone will let me know, I'll post up what I have so far...
Again, thank you for looking.
The data as I initially receive it and format it: Initial Information
The finished waterfall product I am looking to make: Final Waterfall

How can I use excel to generate sentences from a multitude of possible options?

Right now I have a list of around 100 manholes, and each manhole has 8 different things that could be wrong with it (defects), each of those has 12 positions that they could be at in the manhole (think positions on a clock).
For example a manhole could have 2 holes and 1 leak at 5, 7, and 11 o'clock in the manhole.
In Excel I have a column for every type of defect that, when the defect column and manhole row match up, if the manhole has that defect, the number of defects is manually entered into that cell. If there are no defects, they are all left blank in that row. Then, the number of defects and type of defect is put into a different cell for formatting, so it looks like this: (2) holes
The numbers up top along withe at, bench, etc, are all for what I use as references when I'm building my sentences. I reference all the cells individually in order to create a sentence that looks something like this:
68409 has (2) Weepers at 2, 3 o'clock in channel and (1) gusher at 3 o'clock on bench
The Italics show what is selected from the sheet. I want Excel to do all the work for me, rather than typing in something like this every time:
=C4&" has "&AB4&$AB$1&AN4&" "&$AC$1&" "&AD1&" and "&AE4&$AB$1&AQ4&$AC$1&" "&AE1
I'm not sure if Excel can help me at all because there are a lot of references and possibilities. I'm not afraid to have to do some of it myself, like making sure the sentence flows well or even put in heights within the manhole (Cause I need to do that too), but if something could get me started, then that would help a lot.
Thanks!
This is how I tell what time each defect is located at:
This is what my sheet looks like:

How to ignore cell if it is blank?

I have 3 worksheets in a single workbook: Summary, Invoice, and Expense Report. In the Summary sheet list of data, I have named cells as shown below:
Customer_Name: customer name
Billing_Addr_1: 1st line of billing address
Billing_Addr_2: 2nd line of billing address
City_St_Zip: City, State or Province, and Postal Code]
I'd like the info on the Summary Page to generate the Invoice. Everything works fine for Customer_Name, Billing_Addr1 and City_St_Zip. I am having trouble handling customers who do not have a 2nd line of billing address.
If the customer doesn't have that second line (Suite 100 in this case) in the address, I want the invoice to simply skip it and show City_St_Zip.
For example:
with 2nd address line
John Doe Construction Co.
123 Main Street
Suite 100
Anytown USA 12345
without 2nd address
John Doe Construction Co.
123 Main Street
Anytown USA 12345
I have tried:
IF(ISBLANK(Billing_Addr2),City_St_Zip,Billing_Addr_2)
IF(ISBLANK(Summary!$D$15),City_St_Zip,Billing_Addr_2)
IF(ISBLANK(Summary!$D$15),City_St_Zip,Summary!$D$15)
IF(Summary!$D$15=0,City_St_Zip,Summary!$D$15)
I have looked in the help section in Excel itself and found it to be predictably obtuse and of zero help. I've done web searches about this problem and explored the results for quite some time and haven't found the answer. I realize that this is probably a very basic question and am embarrassed to be asking it, but can someone please point out my error?
Thanks in advance.

Trying to find a way to get data from another sheet

I wonder if someone could help me,
I am not a whiz at excel although i know some things, what am after is, I have a worksheets from Monday to Friday, say on a Monday I have time, from, to etc. for car trips, in the 'from' would be the address, I have a list of 1,000 street names on a separate sheet, I want to be able to start typing a street name in the 'from' cell and the street name appear and I can enter it then, is this possible?
I currently have the 1,000 street names above the 'from' column thus it pops up when I start typing, just wanted to know if there was an easier way, as I need to add streets to the list over time, I would be grateful if someone could steer me in the right direction.
So if I understand well, you want to implement automatic completion based on data from another worksheet? Google that. Here is what I found :
http://trumpexcel.com/2013/10/excel-drop-down-list-with-search-suggestions/
http://www.ozgrid.com/forum/showthread.php?t=69642&p=362762#post362762 : cf. the June 1st 2007 comment by Dave Hawley

Resources