Supernova1
New Member
- Joined
- May 5, 2020
- Messages
- 2
- Office Version
- 365
- 2019
- Platform
- Windows
Hi,
I have created a formula for searching in a text string for certain text and returning a value based on the finding the required text.
I have 2 codes which appear in text strings in a report - 0836 = "Charge" and 0102 = "No Charge" - I want to return either of these values based on which code is contained in the text string - Each cell will have either 0836 or 0102 contained in the text string and there will be no conflicting data contained in these cells.
My original formula based on returning the "Charge" value -
=IF(SEARCH("0836",F2),"Charge","N/A")
Now I want to modify this formula to include another argument which states =IF(SEARCH("0102",F2),"No Charge","N/A")
I have tried a few combinations of IF/AND/OR and cannot seem to get both formula to work with each other, this is where i got to...
=IF(SEARCH("0836",F2),"Charge",OR(IF(SEARCH("0102",F2),"No Charge","N/A"))) - this formula will return the "Charge" value but will not return the "No Charge" value when searching for code 0102.
Any help would be greatly appreciated.
I have created a formula for searching in a text string for certain text and returning a value based on the finding the required text.
I have 2 codes which appear in text strings in a report - 0836 = "Charge" and 0102 = "No Charge" - I want to return either of these values based on which code is contained in the text string - Each cell will have either 0836 or 0102 contained in the text string and there will be no conflicting data contained in these cells.
My original formula based on returning the "Charge" value -
=IF(SEARCH("0836",F2),"Charge","N/A")
Now I want to modify this formula to include another argument which states =IF(SEARCH("0102",F2),"No Charge","N/A")
I have tried a few combinations of IF/AND/OR and cannot seem to get both formula to work with each other, this is where i got to...
=IF(SEARCH("0836",F2),"Charge",OR(IF(SEARCH("0102",F2),"No Charge","N/A"))) - this formula will return the "Charge" value but will not return the "No Charge" value when searching for code 0102.
Any help would be greatly appreciated.