Check for a string in a field in excel

Am having a string in a column in excel For ex: Irvine,it can be in capital or small letter like IRVINE or Irvine.I used ToUpper while checking but when its small its not working.
Is there any other way?

Hi @Akhila_Ashok

Can you show what actually you are doing n what all you have used ??

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Hi Pratik,
Am reading an excel and using for each row and checking for a value in if activity like:

row(0).ToString.ToUpper.Contains(“Abc”) and row(1).ToString.ToUpper.Contains(“Abc”) and row(2).ToString.ToUpper.Contains(“Irvine”)

but the excel row am checking the 2nd row can be IRVINE also , so i tried ToUpper function but it is only working when the row value is “IRVINE” not working for “Irvine”

the campare term needs to be in capital as well for a harmonized compare. So it would look like:

row(0).ToString.ToUpper.Contains(“ABC”) and row(1).ToString.ToUpper.Contains(“ABC”) and row(2).ToString.ToUpper.Contains(“IRVINE”)

row(0).ToString.ToUpper.Contains((“Abc”).toUpper) and row(1).ToString.ToUpper.Contains((“Abc”).toUpper) and row(2).ToString.ToUpper.Contains((“Irvine”).toUpper)

1 Like

Hi @Akhila_Ashok

You can also Try like below :-

(row(0).ToString.Contains(“ABC”) Or row(0).ToString.Contains(“Abc”)) And (row(1).ToString.Contains(“ABC”) Or row(1).ToString.Contains(“Abc”)) And (row(2).ToString.Contains(“Irvine”) Or row(2).ToString.Contains(“IRVINE”))

Files for the same :-
MainPratik.xaml (10.1 KB)
New Microsoft Excel Worksheet.xlsx (8.9 KB)

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Thankyou, now its working @Pratik_Wavhal @ppr

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.