Copy and Pasting for Heart Attack Research

o0sleepyeyez

New Member
Joined
Sep 21, 2009
Messages
7
I am trying to copy and paste only the 1 values in column B to paste onto column A. How can I do this without completely pasting over column A? Thank you!

Example of what I see on my Excel sheet below

---A B
1--1 blank
2--5 1
3--0 1
4--0 blank
5--5 1
6--1 1
7--5 blank
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I am trying to copy and paste only the 1 values in column B to paste onto column A. How can I do this without completely pasting over column A? Thank you!

Example of what I see on my Excel sheet below

---A B
1--1 blank
2--5 1
3--0 1
4--0 blank
5--5 1
6--1 1
7--5 blank

I am not sure what you mean by saying "without completely pasting over column A." Do you want to paste at the bottom of the range, so for your example you would have the value of 1 in cells A8:A11?

If so, a simple way to do it would be to

1. Apply a filter to your data, and filter by the number 1 in column B.
2. Highlight all of the 1's, and press ALT + ; to select only the visible cells.
3. Copy the cells by pressing CTRL + C
4. Unfilter the range
5. Paste in the next empty cell in column A

If this is not what you are looking for, post back with a bit more detail.

Hope that helps.
 
Upvote 0
I have a question on my survey that asks "have you had a heart attack in the last 2 years" (once asked in 2006 and once asked in 2008) and I am trying to combine these two data sets. The two data sets are in two columns and lined up next to each other based on the patient number (e.g. 1st row = patient #1, 2nd row = patient #2,) and the 1st column = 2006 data and 2nd column = 2008 data. I am trying to observe if various factors predict if a person is likely to have a heart attack in the next 4 years.

Hence I am trying to merge two columns with different values having priority (let me explain). “1” = 1st priority, “5” = 2nd priority, and a blank cell= last priority. What I mean by priority is that if two cells are lined up next to each other, and the cell on left has a “1”, it would replace the “5” on the right. Another example would be if two cells are lined up next to each other and cell on the left has a “1”, it would replace a blank cell on the right. Same with a “5” replacing a blank cell.

Ultimately, I would like to end up with 1 column that has the two columns of data merged. Data that shows if a person has had a heart attack in the last 4 years.

I hope this makes sense! Thank you.
 
Upvote 0
I am not sure if I follow exactly...can you show what your desired column would look like? In your 2006 column you have"0's"...what is the result in that situation. Also, as far as filling in a blank, do you want an actual blank cell, or just text saying "Blank"?
Excel Workbook
ABCD
1Patient Number20062008Test Column
2Patient 115
3Patient 251Blank
4Patient 301Blank
5Patient 40Blank
6Patient 551Blank
7Patient 6115
8Patient 75Blank
Sheet1
Excel 2007
Cell Formulas
RangeFormula
D2=LOOKUP(B2,{0,1,5},{"Blank",5,"Blank"})
D3=LOOKUP(B3,{0,1,5},{"Blank",5,"Blank"})
D4=LOOKUP(B4,{0,1,5},{"Blank",5,"Blank"})
D5=LOOKUP(B5,{0,1,5},{"Blank",5,"Blank"})
D6=LOOKUP(B6,{0,1,5},{"Blank",5,"Blank"})
D7=LOOKUP(B7,{0,1,5},{"Blank",5,"Blank"})
D8=LOOKUP(B8,{0,1,5},{"Blank",5,"Blank"})
 
Upvote 0
Sorry I made it confusing! The blanks and 0's are the same things. I would like there to be a hierarchy where 1 would always paste over a 5 and 0, and a 5 would always paste over a 0.

---A B Desired Column
1--1 0 1
2--5 1 1
3--0 1 1
4--0 0 0
5--5 1 1
6--1 1 1
7--5 0 5

Thank you so much for your help!
 
Upvote 0
Give this one a try...the results match the desired, so test it out to make sure that it meets the desired results in your sheet.
Excel Workbook
ABCDEF
1Patient Number20062008Desired ColumnCombined ColumnDesired = Combined?
2Patient 1111TRUE
3Patient 25111TRUE
4Patient 3111TRUE
5Patient 400TRUE
6Patient 55111TRUE
7Patient 61111TRUE
8Patient 7555TRUE
Sheet1
Excel 2007
Cell Formulas
RangeFormula
E2=IF(ISBLANK(C2),B2,C2)
E3=IF(ISBLANK(C3),B3,C3)
E4=IF(ISBLANK(C4),B4,C4)
E5=IF(ISBLANK(C5),B5,C5)
E6=IF(ISBLANK(C6),B6,C6)
E7=IF(ISBLANK(C7),B7,C7)
E8=IF(ISBLANK(C8),B8,C8)
F2=E2=D2
F3=E3=D3
F4=E4=D4
F5=E5=D5
F6=E6=D6
F7=E7=D7
F8=E8=D8
 
Upvote 0
I just figured out that this solution doesn't work because when the "1"s are to the left of the 5, it does not work. It only works when "1"s are to the right of the 5.

Any help would be much appreciated!
 
Upvote 0

Forum statistics

Threads
1,223,719
Messages
6,174,089
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top