excel macros- mergine info on diff rows based on ID
Can someone help me go through the steps of creating a macro that merges row with the sam开发者_开发技巧e ID but with different info? This is an example:
ID | info1 | info2 | info3 | info4
1 | T | F | F | F
1 | F | T | F | F
1 | F | F | F | T
2 | T | F | F | F
2 | F | F | T | F
so this would ouptut:
ID | info1 | info2 | info3 | info4
1 | T | T | F | T
2 | T | F | T | F
Non-VBA solution, just in case.
- Create list of unique ids. For this
example, id list is in Column H,
with first entry in
H2
. Enter this formula in
I2
, info1 value for ID 1:=IF(SUM(IF($A$2:$A$6=$H2,IF(B$2:B$6="T",1,0),0))=0,"F","T")
Adjust row numbers and columns to match your data.
Press Ctrl+Shift+Enter to enter the formula as an array formula. The formula will show up in {...}.
Fill I2 down to cover each unique id. Fill to the right to cover each info column.
精彩评论