Hello,
I've read a bit already on this but what is posted doesn't seem to meet my needs.
I have a large table of data that contains a column with an exact Organism specification (genus and species). Some rows even have multiple organisms delimited by a semicolon (. The data is pulled from a oracle DB. There is also another column that I am going to have to calculate called "Gram +/-". The table looks like this:
<tbody>
</tbody>
The "Gram +/-" is determined by the "Genus" of the organism. So in the Organism the genus part would be the first word (ie. Staphylococcus, Bacillus, Enterococcus, Pseudomonas). The relationship between these and Gram +/Gram - would just be stored in a lookup table is what I was thinking. Like this.
<tbody>
</tbody>
However, I can't seem to determine a way to match "Staphylococcus capitis" (and the others) against a lookup table like the following for "partial string matches". And I also need it to be able to match multiple times for those that have multiple organisms. The table would ideally end up like this;
<tbody>
</tbody>
I have a feeling this just might not work. The best I've come up with is;
but that won't find partial matches when there are more then one organism.
I've read a bit already on this but what is posted doesn't seem to meet my needs.
I have a large table of data that contains a column with an exact Organism specification (genus and species). Some rows even have multiple organisms delimited by a semicolon (. The data is pulled from a oracle DB. There is also another column that I am going to have to calculate called "Gram +/-". The table looks like this:
ID | Organism | Gram +/- |
1 | Staphylococcus capitis | |
2 | Bacillus species;Staphylococcus capitis | |
3 | Staphylococcus aureus;Enterococcus faecalis;Pseudomonas aeruginosa |
<tbody>
</tbody>
The "Gram +/-" is determined by the "Genus" of the organism. So in the Organism the genus part would be the first word (ie. Staphylococcus, Bacillus, Enterococcus, Pseudomonas). The relationship between these and Gram +/Gram - would just be stored in a lookup table is what I was thinking. Like this.
Genus | Gram +/- |
Staphylococcus | + |
Bacillus | + |
Enterococcus | - |
Pseudomonas | - |
<tbody>
</tbody>
However, I can't seem to determine a way to match "Staphylococcus capitis" (and the others) against a lookup table like the following for "partial string matches". And I also need it to be able to match multiple times for those that have multiple organisms. The table would ideally end up like this;
ID | Organism | Gram +/- |
1 | Staphylococcus capitis | + |
2 | Bacillus species;Staphylococcus capitis | +;+ |
3 | Staphylococcus aureus;Enterococcus faecalis;Pseudomonas aeruginosa | +;-;- |
<tbody>
</tbody>
I have a feeling this just might not work. The best I've come up with is;
Code:
=IF(ISERROR(LOOKUP(2^15,SEARCH(lookup_gram[Genus],[@Organism]),lookup_gram[Genus])),"",LOOKUP(2^15,SEARCH(lookup_gram[Genus],[@Organism]),lookup_gram[Gram]))