Return value from range that does not include specific text

john-paul

New Member
Joined
Nov 23, 2008
Messages
37
Office Version
  1. 365
Platform
  1. Windows
Hi,

I need to return the first value from a range that does not include "See role ...", "Acting in ...", or is blank, based on an input of "Role" number.

Result should be:
10 = Sam Smith
11 = Sam Smith
12 = Bob Brown
13 = Robert Roberts
14 = Walter Woods
15 = Walter Woods
16 = David Davis

Also, is it possible to switch the search to start right to left, so that role 11 picks up Jane Jones, and role 15 picks up Mark Michael, ie: first non-blank, not including "See role ..." or "Acting in.." from right to left?

Thank you
John-Paul

Role
Role OwnerCovered ByTemporary Worker
10See role 11Sam Smith
11Sam SmithActing in role 10Jane Jones
12Bob Brown
13Robert Roberts
14See role 15Walter Woods
15Walter WoodsActing in role 14Mark Michael
16See role 99David Davis
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I don't understand your scenario.
Lines 10 & 11 have "See role" or "Acting in" yet you want Sam Smith to show up, what qualifier have I missed?
 
Upvote 0
Try:
Book1
ABCDEF
1RoleRole OwnerCovered ByTemporary WorkerLeft to rightRight to Left
210See role 11Sam SmithSam SmithSam Smith
311Sam SmithActing in role 10Jane JonesSam SmithJane Jones
412Bob BrownBob BrownBob Brown
513Robert RobertsRobert RobertsRobert Roberts
614See role 15Walter WoodsWalter WoodsWalter Woods
715Walter WoodsActing in role 14Mark MichaelWalter WoodsMark Michael
816See role 99David DavisDavid DavisDavid Davis
Sheet2
Cell Formulas
RangeFormula
E2:E8E2=XLOOKUP(1,(B2:D2<>"")*ISERROR(SEARCH("role",B2:D2)),B2:D2,,,1)
F2:F8F2=XLOOKUP(1,(B2:D2<>"")*ISERROR(SEARCH("role",B2:D2)),B2:D2,,,-1)


If you want both left to right and right to left in one formula, you can use an array like this.
Excel Formula:
=XLOOKUP(1,(B2:D2<>"")*ISERROR(SEARCH("role",B2:D2)),B2:D2,,,{1,-1})
 
Upvote 0
Solution
Thanks Cubist that is great!
If I had an input cell (H1) to select an individual role number can the formula be adjusted so it returns the workers name in I1 (L to R) and J1 (R to L)?
 
Upvote 0
Like this?
Book3
ABCDGHIJ
1RoleRole OwnerCovered ByTemporary Worker11Sam SmithJane Jones
210See role 11Sam Smith
311Sam SmithActing in role 10Jane Jones
412Bob Brown
513Robert Roberts
614See role 15Walter Woods
715Walter WoodsActing in role 14Mark Michael
816See role 99David Davis
Sheet3
Cell Formulas
RangeFormula
I1:J1I1=LET(f,FILTER(B2:D8,A2:A8=H1),XLOOKUP(1,(f<>"")*ISERROR(SEARCH("role",f)),f,,,{1,-1}))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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