cancel
Showing results for 
Search instead for 
Did you mean: 

In String Function will not recognise Text

UsamaZubair2
Level 2

Hi, 

I am trying to match a cell value from excel and a collection and trying to get this code to run in a decision stage however the InStr function is showing the result as false even though it should be true on the match. Can anyone please help with this. Thanks

35796.png

1 REPLY 1

dochrymuk
Level 4

Hi,

What is important, the Instr function tests whether the smaller string substring is contained in the longer string.

Example: Instr("TestValue","Value") will return value 5  because the word "Value" first occurs at the fifth character.

In the example you provided, the function correctly returns the False value, because the result of the function is 0. This is mainly due to the fact that the first text after the word Collar contains the value No and the second text contains the value Number. In order for the return value to be True in your example, the given word from the collection would have to be, for example, only Collar.

First of all, remember that this function verifies whether the first given text contains the second one and in what place, and it is very important to properly place the variables in the function.

Dawid Ochrymuk Manager KPMG Poland