Complicated Excel issue for me

%3CLINGO-SUB%20id%3D%22lingo-sub-1638061%22%20slang%3D%22en-US%22%3EComplicated%20Excel%20issue%20for%20me%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1638061%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20attempting%20to%20format%20an%20excel%20sheet%20to%20be%20able%20to%20upload%20information%20to%20a%20program.%20In%20the%20extract%20I've%20pulled%2C%20if%20a%20person%20has%20more%20than%20one%20emergency%20contact%20it%20creates%20a%20second%20row%20with%20almost%20all%20of%20the%20same%20information%20as%20the%20previous%20row%20except%20the%20name%20of%20the%20contact%2C%20phone%20number%2C%20and%20email%20address.%20I%20would%20like%20to%20pull%20the%20secondary%20contact%2C%20phone%20number%2C%20and%20email%20address%20and%20add%20it%20to%20the%20end%20of%20the%20first%20row%2C%20essentially%20creating%20three%20new%20rows.%20I%20would%20then%20like%20to%20delete%20any%20rows%20that%20I%20have%20pulled%20that%20information%20from.%26nbsp%3B%20Is%20this%20possible%20with%20formula%20or%20two.%20I%20can't%20manually%20do%20this%20because%20the%20file%20has%20over%2024%2C000%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20assistance%20would%20be%20helpful.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1638061%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1638081%22%20slang%3D%22en-US%22%3ERe%3A%20Complicated%20Excel%20issue%20for%20me%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1638081%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F783129%22%20target%3D%22_blank%22%3E%40BuffaloBrian%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPerhaps%20Power%20Query%20could%20help%2C%20implementation%20slightly%20depends%20on%20do%20you%20always%20have%20one%20secondary%20row%2C%20or%20that%20could%20be%20no%20one%20or%20few%20of%20them.%20Idea%20is%20to%20generate%20ID%20(index)%20which%20will%20be%20the%20same%20for%20main%20and%20secondary%20row(s)%2C%20after%20that%20group%20on%20it%20or%20merge%20table%20with%20all%20main%20rows%20with%20the%20table%20which%20is%20filtered%20for%20secondary%20rows%20only.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1638118%22%20slang%3D%22en-US%22%3ERe%3A%20Complicated%20Excel%20issue%20for%20me%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1638118%22%20slang%3D%22en-US%22%3EThere%20is%20not%20always%20a%20secondary%20row.%20If%20the%20person%20does%20not%20have%20a%20secondary%20contact%20the%20next%20row%20is%20the%20next%20person%20in%20my%20spreadsheet.%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I'm attempting to format an excel sheet to be able to upload information to a program. In the extract I've pulled, if a person has more than one emergency contact it creates a second row with almost all of the same information as the previous row except the name of the contact, phone number, and email address. I would like to pull the secondary contact, phone number, and email address and add it to the end of the first row, essentially creating three new rows. I would then like to delete any rows that I have pulled that information from.  Is this possible with formula or two. I can't manually do this because the file has over 24,000 rows.

 

Any assistance would be helpful.

6 Replies
Highlighted

@BuffaloBrian 

Perhaps Power Query could help, implementation slightly depends on do you always have one secondary row, or that could be no one or few of them. Idea is to generate ID (index) which will be the same for main and secondary row(s), after that group on it or merge table with all main rows with the table which is filtered for secondary rows only.

Highlighted
There is not always a secondary row. If the person does not have a secondary contact the next row is the next person in my spreadsheet.
Highlighted

@BuffaloBrian 

That's solvable. Main question do you consider Power Query as an option or not. If yes, better if you submit small sample file with different variants for the secondary rows.

Highlighted

@BuffaloBrian 

Another option could be VBA, but that's not my territory.

Highlighted

@BuffaloBrian  I think you can create a new list on another sheet using a set of formulas:

first pull the UNIQUE() rows based on the original persons name and information (everything up to the emergency contact info)

next use a LOOKUP function to pull the 1st row of emergency contact info 

last use a combination of COUNTIF (determine if there are 2 rows) and INDEX()-MATCH()+1 to find the secondary Emergency contact info.  

This would be easier to demo in an actual sheet with your non-personal info in it but I have attached a sample I created.

Note I used "Address" as a unique value in the list but if you don't have a unique field (i.e. SS#, ID#, etc...) you could create a temp field where you concatenate multiple fields to create that unique field (example shown in sheet) or create a more complicated formula.

 

Highlighted

@mtarler 

Maybe, with assumption that source data as in your sample

image.png

My guess it looks like

image.png

but better to have the sample