Excel Formula to check if two strings exist in the same row on a sheet without specifying the column

Knockoutpie

Board Regular
Joined
Sep 10, 2018
Messages
116
Office Version
  1. 365
Platform
  1. Windows
Hello everyone, i'm trying to find out if there is a way to determine if two strings are in the same row somewhere on a sheet.

Right now i'm half way there, my not so elegant solution is just to count if a string exists in a sheet.

Excel Formula:
=COUNTIF('Sheet2'!3:100,Sheet1!B5)

This formula checks Sheet 2 row 3:100 if the value of B5 in Sheet 1 exists.

Excel Formula:
=IFERROR(ROW(INDEX(Sheet2!E:E,MATCH(1,("String1"=Sheet2!E:E)*("String2"=Sheet2!H:H)*("String3)"=Sheet2!A:A),0))),"9999")

This formula will return the row number the criteria are all found on, if not found, return 9999. The only issue with this is I have to specify the column on where the strings will be. Occasionally the columns move around.

My ideal formula: Find two criteria which are in the same row, without specifying the column, and then return the row number.


Any help would be greatly appreciated.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Can you post an example of the data you are working with.

This might be an option.

Assuming you want to search for the string in Column A, on range B;D

VBA Code:
=FILTER(ROW(A1:A6),COUNTIF(B1:D6,A1:A6))
This formula returns:

1707415860252.png
 
Upvote 0
Hi all, this is the answer.

=TEXTJOIN(", ",,FILTER(ROW(3:100),BYROW('Sheet2'!3:100,LAMBDA(Z,ISNUMBER(MATCH("String1",Z,0))*ISNUMBER(MATCH("String2",Z,0)))))
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,953
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top