Muhammad Toseef
New Member
- Joined
- Apr 18, 2017
- Messages
- 1
I have a diseases dataset saved in MS Excel sheet, the format of the data is given below:
I have a diseases dataset saved in MS Excel sheet, the format of the data is given below:
where the first column is entering variable i.e name of some object and the leaving column i.e. last column is a disease name. The columns in between are the symptoms columns for the specific disease of that object.
Now, for each row in the sheet, I want to get all the symptoms attribute where the value is 1, i.e. this symptom is present, using Disease column as a decision variable. Logic is given below.
<code>
The desired result for the first rows is as follow;
How can I do this in MS Excel, using IF formula? Help in this regard will be highly appreciated.</code>
I have a diseases dataset saved in MS Excel sheet, the format of the data is given below:
HTML:
| Object Name | Symptom 1 | Symptom 2 | Symptom 3 |...| Symptom N | Disease |
| ABC | 1 | 0 | 0 |...| 1 | XYZ |
| ABC | 0 | 1 | 0 |...| 0 | XYZ |
| ABC | 1 | 0 | 1 |...| 1 | XYZ |
| ABC | 1 | 1 | 0 |...| 0 | XYZ |
where the first column is entering variable i.e name of some object and the leaving column i.e. last column is a disease name. The columns in between are the symptoms columns for the specific disease of that object.
Now, for each row in the sheet, I want to get all the symptoms attribute where the value is 1, i.e. this symptom is present, using Disease column as a decision variable. Logic is given below.
Code:
<code>
for each row in the sheet </code><code>
--> IF (Disease = XYZ)
--> Get all the Symptoms variables where value is 1</code>
The desired result for the first rows is as follow;
HTML:
Row 1 --> XYZ (Symptom1)
Row 2 --> XYZ (Symptom2)
Row 3 --> XYZ (Symptom1, Symptom3)
Row 4 --> XYZ (Symptom1, Symptom2)
How can I do this in MS Excel, using IF formula? Help in this regard will be highly appreciated.</code>