LearnNewThings
New Member
- Joined
- Aug 27, 2019
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
I have a formula that searches a string of text in one sheet, and sets the value of the cell where the formula is stored based on the true/false boolean results. The problem is, it will return true when it is a partial match instead of an exact match and I can't seem to find out how to only return true when it is exact. I have nested search and exact functions, but this isn't fixing the problem completely.
Ex: search criteria in sheet Dashboard cell A2 is the number 310, it searches a string (1200;1300;1400;3100;3200) in sheet MachData Cell B2 of and returns true because it found 310 within 3100. I only want it to return true if it finds 3100 exactly.
Any help is greatly appreciated.
Current formula which works for all values that are not "Similar" ie 310 & 3100, 910 & 9105, etc
=IF(MachData!$A$2,IF((ISNUMBER(SEARCH($A2,MachData!$B$2))),$A2,$A2&" "),$A2&" ")
Example of tables are below. I have conditional formatting to turn cell green if cell ISNUMBER. The cell turns green if either 310 or 910 are entered, even though those exact values are not in the string on the MachData page. In the example below, I want it to return a FALSE not TRUE.
Dashboard sheet:
[TABLE="class: grid, width: 600"]
<tbody>[TR]
[TD]Code[/TD]
[TD]MachCode[/TD]
[/TR]
[TR]
[TD]310[/TD]
[TD]=IF(MachData!$A$2,IF((ISNUMBER(SEARCH($A2,MachData!$B$2))),$A2,$A2&" "),$A2&" ")[/TD]
[/TR]
</tbody>[/TABLE]
MachData sheet:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Unattended[/TD]
[TD]MachCodes[/TD]
[/TR]
[TR]
[TD]TRUE[/TD]
[TD][TABLE="width: 166"]
<tbody>[TR]
[TD="width: 166"]1200;1300;1400;3100;9105[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Ex: search criteria in sheet Dashboard cell A2 is the number 310, it searches a string (1200;1300;1400;3100;3200) in sheet MachData Cell B2 of and returns true because it found 310 within 3100. I only want it to return true if it finds 3100 exactly.
Any help is greatly appreciated.
Current formula which works for all values that are not "Similar" ie 310 & 3100, 910 & 9105, etc
=IF(MachData!$A$2,IF((ISNUMBER(SEARCH($A2,MachData!$B$2))),$A2,$A2&" "),$A2&" ")
Example of tables are below. I have conditional formatting to turn cell green if cell ISNUMBER. The cell turns green if either 310 or 910 are entered, even though those exact values are not in the string on the MachData page. In the example below, I want it to return a FALSE not TRUE.
Dashboard sheet:
[TABLE="class: grid, width: 600"]
<tbody>[TR]
[TD]Code[/TD]
[TD]MachCode[/TD]
[/TR]
[TR]
[TD]310[/TD]
[TD]=IF(MachData!$A$2,IF((ISNUMBER(SEARCH($A2,MachData!$B$2))),$A2,$A2&" "),$A2&" ")[/TD]
[/TR]
</tbody>[/TABLE]
MachData sheet:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Unattended[/TD]
[TD]MachCodes[/TD]
[/TR]
[TR]
[TD]TRUE[/TD]
[TD][TABLE="width: 166"]
<tbody>[TR]
[TD="width: 166"]1200;1300;1400;3100;9105[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]