0

Here is a snip of my data for reference

enter image description here

Column A contains 9134 study IDs and column B contains 9467 study IDs. I have previously applied exclusions to column A (it was once column B before I deleted certain people due t exclusion) Columns C-G is the new data which corresponds to column B (there are 9467 rows of the data)

What I am looking to do is match the data to column A..for example "Study ID 2 #1195" I would like that data to line up with that Study ID 1 #1195 in column A

ALSO, because I intentionally deleted some people from column A, there are Study ID 2 #'s that have been deleted from Study ID 1..so I am not interested in those people

The ultimate goal is to line up the data with column A in order to copy and paste seamlessly into an existing SPSS database

I am not sure how to go about this. Any help would be greatly appreciated!!

HERE IS A LINK TO MY DATASET https://drive.google.com/open?id=1lhbuthqNPLLi8KRVmCOEqmBkh5dy2C41

MSBSresearch
  • 53
  • 1
  • 4
  • 1
    Do not *EVER(!!!)* combine two datasets by copying and pasting. Look up SPSS `match files` command, which easily takes care of matching each line of one dataset to the adequate line in a different dataset (similar function to vlookup suggested below but much much more efficient). You'll base the match on `study_ID' and you're all set with one line of code (or one command in the menu). If you run into problems with this process your're welcome to ask here and we'll be glad to help. But do. not. use. copy and paste. – eli-k May 10 '20 at 06:35
  • 1
    You are a legend Eli – MSBSresearch May 11 '20 at 14:21
  • I will let you know here if I have any questions – MSBSresearch May 11 '20 at 14:22

1 Answers1

1

This seems like more of an excel question than any kind of coding question. I think all you want to do is keep records where the study id exists in column A.

This can be achieved in Excel y doing a vlookup on column b where you check if a record exists in column A.

You can then filter out any records that don't exist and copy that information to a new sheet.

Example:

Add new column

enter image description here

Apply filter:

enter image description here

jawsem
  • 751
  • 5
  • 8