How to check rows for to replace a value for another in Calc?

Hi again!

I have a problem in Calc. I get a lot of spreadsheets from various sources and I have to compile one big sheet with the information of every one of them. One of the problems I am facing is that there is a lot of names for the same user. So, for example:

PHONE EXTENSION Name Sheet A
111 John Doe

PHONE EXTENSION Name Sheet B
111 Jon Doe

PHONE EXTENSION Name Sheet C
111 J. Doe

Right now, I have kind of a table relating one to another but it is absolutely atrocious:

EXT. Name A Name B
111 John Doe J. Doe
111 John Doe Jon Doe

I would like a system where I could have only one row for person:

EXT. Name A Name B Name C Name D
111 John Doe J. Doe Jon Doe ...
112 Dorian Gray D. Gray Don Gray ...

And once the table is properly established, I would want to replace every appearance of Name B, Name C with the value of Name A.
If any of you would want to help me pointing how this could be done, I would be immensely grateful.

Thank you!

I have a problem in Calc. I get a lot of spreadsheets from various sources and I have to compile one big sheet with the information of every one of them. One of the problems I am facing is that there is a lot of names for the same user. So, for example:

PHONE EXTENSION Name Sheet A
111 John Doe

Is "Name Sheet A" a column heading, or do you mean column headed "Name" on Sheet A?

EXT. Name A Name B
111 John Doe J. Doe
111 John Doe Jon Doe

I would like a system where I could have only one row for person:

EXT. Name A Name B Name C Name D
111 John Doe J. Doe Jon Doe ...
112 Dorian Gray D. Gray Don Gray ...

And once the table is properly established, I would want to replace every appearance of Name B, Name C with the value of Name A.

Once you have done that, you get back to an exact copy of Sheet A - except that you will have blanks for the name where an extension appears on one of the other lists but not on Sheet A. I can't imagine that that's what you really want.

Won't you need to use a certain amount of intelligence and discretion in deciding what name you actually want and dealing with discrepancies? In that case, wouldn't it be simpler to:
o Copy the material to a single sheet.
o If preferred, give the cells from each sheet a background colour to identify them.
o Sort the sheet by the "extension" column.
o Go through the material manually, choosing which of the multiple rows for each extension to retain, marking these with some random character in a new column. (Or you could choose to mark the rows you didn't need.)
o Sort the sheet again, this time by the new column.
o Delete the range of rows - now all adjacent - without the mark.
o Remove the background colours.

If this doesn't work, it may be that you have not given sufficient detail about your problem.

I trust this helps.

Brian Barker

I think you can do that with the funtcion VLOOKUP

something like:
=VLOOKUP(A2;'file:///C:/temp/SheetB.ods'#$Sheet1.A1:B5;2; )

Hello again!

I wanted to update you guys. I created a new table manually with the fields:
EXT EMAIL FULL NAME

I proceeded to fill them making sure no value was repeated. So now I have a table that is capable of converting EXT to EMAIL or FULL NAME; or EMAIL to FULL NAME with vlookup().

I also need to look up to the left side so, for example, if I want to extract the email from a full name I can vlookup() the name and check the adjacent cells. The problem is vlookup() only looks to the right side of the first column so I've used vlookup(choose()) to be able to look up the values to the left side. This feels like bad formula all around and would like your opinion in which is a good way to do what I want to do.

The exact formula is this:

= VLOOKUP( VLOOKUP( D5,CHOOSE( {2,1}, ext_mail.$B$1:$B$100,

ext_mail.$E$1:$E$100), 2, 0), $A$3:$B$51, 2, 0)|

So it is a choose() nested in a vlookup() which is nested in another vlookup(). Bad code all around.

Thanks for your time!