I'm trying to combine a couple of tables together and am having some problems. Basically my data sheets look like the following
| Age | Sex |
| Patient A | 13 | M |
| Patient B | 15 | F |
| | Diagnosis |
Patient A | Diabetes |
| Patient A | HTN |
| Patient B | Asthma |
| Patient B | HTN |
| Patient B | Sepsis |
I'm trying to make a table to combine the diagnoses with the patient codes (to look like the table below), but each patient diagnosis is represented individually in my current excel format rather than combining each patient with all their diagnoses. Is there an easy way to combine these two tables? Thanks!
| | Age | Sex | Diabetes | HTN | Asthma | Sepsis |
| Patient A | 13 | M | 1 | 1 | 0 | 0 |
| Patient B | 15 | F | 0 | 1 | 1 | 1 |