Oct 19 2022 10:23 AM
Hi, I'm a newbie with excel. I am not having much luck finding a way to take an address list that is formatted with both spouses as a name, and change it to individuals. I Can split the names, text to columns no problem. However, I also have to duplicate it on the next row so that the list is formatted with individuals. here's the example. Im sure it's easy, im just a struggling newb.
HAVE THIS | |||||||
FAMILY NAME | MEMBER NAME | ADDRESS 1 | CITY | STATE | ZIP | PRIMARY/HOME PHONE | EMAIL ADDRESS |
Doe | John and Jane | 2 Elm St | Lockwood | IN | 456789 | 555-555-5555 | email address removed for privacy reasons ; email address removed for privacy reasons |
NEED THIS | |||||||
FAMILY NAME | MEMBER NAME | ADDRESS 1 | CITY | STATE | ZIP | PRIMARY/HOME PHONE | EMAIL ADDRESS |
Doe | John | 2 Elm St | Lockwood | IN | 456789 | 555-555-5555 | email address removed for privacy reasons |
Doe | Jane | 2 Elm St | Lockwood | IN | 456789 | 555-555-5555 | email address removed for privacy reasons |
Oct 19 2022 11:16 AM
Oct 19 2022 11:38 AM
can you elaborate? Appreciate the help.
Oct 19 2022 11:54 AM
If Power Query is available on your computer you can open the file that is attached to my previous post. Then you can enter data in the blue dynamic table. Then you can click in any cell of the green table, right-click with the mouse and refresh.
Oct 19 2022 12:01 PM
Oct 19 2022 12:17 PM
Did you get the expected result? If so it should be possible to copy the 300+ contacts from the other file and paste them into the blue dynamic table. Then you can refresh the green table. In the attached file i've rearranged the layout of the tables. You can enter huge numbers of contacts in the blue table.
Oct 19 2022 12:51 PM
i was sent with the name in one row. I split them up with text to columns. I should have included the specific layout in the beginning. I see what you are saying with copy and pasting to your data query file, but my info is going all over the place. this is an example of where I am now. Under family it would have said Accardo John & marlene.
FAMILY | NAME | Primary Address | address 2 | City | State | zip | Primary Phone | E-Mail Address | ||||
Accardo | John | & | Marlene | 68 elm | Cody | WY | 82414 | 307-586-0000 | email address removed for privacy reasons | |||
Adkins | Joanne | and | david | 2202 main St | Cody | WY | 82414 | 307-527-0000 | email address removed for privacy reasons | |||
Agudo | Freddy | & | mary | PO Box main | Cody | WY | 83214 | 000-000-000 | email address removed for privacy reasons | |||
Alexander | Steven | & | dennis | 1313 Red elm ave. | Cody | WY | 82414 | |||||
Alvarado | Nicole | & | jamie | 29 house rd | Henderson | NV | 89011 | 307-527-0000 |
Oct 19 2022 12:58 PM
If you have 365 you might use a LAMBDA.
This LAMBDA simply pulls each row twice.
=LAMBDA(range,LET(data,range,r,ROWS(data),CHOOSEROWS(data,INT(SEQUENCE(r*2,,1,1/2)))))
This formula uses SCAN on the Member Name column. With the aid of some extraction, it pulls the name before or after the "and" where needed:
=LAMBDA(range,SCAN("",CHOOSECOLS(PullRows(range),2),LAMBDA(a,v,IF(TEXTBEFORE(v," ")=a,TEXTAFTER(v," and "),TEXTBEFORE(v," ")))))
HSTACK combines the arrays horizontally:
=LET(data,E2:L4,HSTACK(TAKE(PullRows(data),,1),MemberName(data),CHOOSECOLS(PullRows(data),SEQUENCE(,6,3,1))))
Oct 19 2022 01:04 PM
Oct 19 2022 02:00 PM
Oct 19 2022 03:28 PM
Sub names()
Dim i As Long
Dim j As Long
Dim k As Long
Range("P:AB").Clear
k = Range("A" & Rows.Count).End(xlUp).Row
j = 2
For i = 2 To k
Range(Cells(i, 1), Cells(i, 13)).Copy Destination:=Range(Cells(j, 16), Cells(j, 28))
Range(Cells(j, 18), Cells(j, 19)).Clear
j = j + 1
Range(Cells(i, 1), Cells(i, 13)).Copy Destination:=Range(Cells(j, 16), Cells(j, 28))
Cells(j, 17).Value = Cells(j, 19).Value
Range(Cells(j, 18), Cells(j, 19)).Clear
j = j + 1
Next i
End Sub
You can try these lines of code. In the attached file in sheet "Tabelle2" you can click the button in cell O2 to run the macro.
After copying your data select cell A2 in sheet "Tabelle2" and paste the data. The data should be entered in columns A to M. There can be hundreds of rows (actually tens of thousands, however that would affect the runtime of the macro) in columns A to M.