Combine two index match formulas into single formula

dejamls

New Member
Joined
Nov 22, 2015
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hi all

I have these two formulas which work but I need to combine into one formula. I tried a few things but unsuccessful and given up. I could create helper columns but rather use single formula.

=IF($A11="","",IFERROR(IF(INDEX(PDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("*"&"Code Red"&"*",PDA!$Q$2:$Q$1048576)*SEARCH($A11,PDA!$B$2:$B$1048576)),0))=TRUE,"N","Y"),""))

=IF($A11="","",IFERROR(IF(INDEX(RDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("*"&"Code Red"&"*",RDA!$U$2:$U$1048576)*SEARCH($A11,RDA!$B$2:$B$1048576)),0))=TRUE,"N","Y"),""))

I need to combine them. Can someone help combine them please into one formula.

🙏 😊
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
what do you want to do in the cell with the two values that each formula returns?
 
Upvote 0
Because $A11 value (i.e. document number) in a sheet called DOCUMENT could be present in in either sheet (PDA or RDI in their respective column B), if it finds it then will check another column in respective sheet (Q for PDA and U for RDI) for partial string match "code red". Then if found return "Y"or if not found "N".

Hope that makes sense.
 
Upvote 0
so, you want ti to be an OR statement? Is the only difference in the formulas the Sheet Reference?
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
How about
Excel Formula:
=IF($A11="","",IF(OR(IFERROR(INDEX(PDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH(Code Red",PDA!$Q$2:$Q$1048576)*SEARCH($A11,PDA!$B$2:$B$1048576)),0)),""),IFERROR(INDEX(RDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("Code Red",RDA!$U$2:$U$1048576)*SEARCH($A11,RDA!$B$2:$B$1048576)),0)),"")),"N","Y"))
 
Upvote 0
How about
Excel Formula:
=IF($A11="","",IF(OR(IFERROR(INDEX(PDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH(Code Red",PDA!$Q$2:$Q$1048576)*SEARCH($A11,PDA!$B$2:$B$1048576)),0)),""),IFERROR(INDEX(RDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("Code Red",RDA!$U$2:$U$1048576)*SEARCH($A11,RDA!$B$2:$B$1048576)),0)),"")),"N","Y"))

Hi Fluff. Tried it (added wild cards to "code red" text i.e. "*"&"Code Red"&"*" as it always appears in a string of text ), but I get a #VALUE error. Cheers

Excel Formula:
=IF($A11="","",IF(OR(IFERROR(INDEX(PDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("*"&"Code Red"&"*",PDA!$Q$2:$Q$1048576)*SEARCH($A11,PDA!$B$2:$B$1048576)),0)),""),IFERROR(INDEX(RDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("*"&"Code Red"&"*",RDA!$U$2:$U$1048576)*SEARCH($A11,RDA!$B$2:$B$1048576)),0)),"")),"N","Y"))
 
Upvote 0
added wild cards to "code red" text i.e. "*"&"Code Red"&"*"
You don't need them, search will look for cells that contain the value, not equals it.

Can you post some sample data from both sheets.
 
Upvote 0
DOC Sheet

SAMPLE WB.xlsx
ABCDEF
1
2
3
4
5
6
7
8
9
10Document NoDocument Title Version No.Dept SetAreaCode Red Y / N
11XYZTRUCK FORM#VALUE!
12FGHWORK INSTRUCTION CHANGE REQUEST AND SIGN OFF FORM#VALUE!
13DFGTRUCK PERFORMANCE REVIEW#VALUE!
14GHFPROCESS CHANGE REQUEST FORM#VALUE!
15ABCTRUCK INSPECTION#VALUE!
16YUHTRUCK MAINT#VALUE!
17ZDGPROCESS CHANGE REQUEST FORM#VALUE!
DOC
Cell Formulas
RangeFormula
F11:F17F11=IF($A11="","",IF(OR(IFERROR(INDEX(PDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("Code Red",PDA!$Q$2:$Q$1048576)*SEARCH($A11,PDA!$B$2:$B$1048576)),0)),""),IFERROR(INDEX(RDA!$B$2:$B$1048576,MATCH(TRUE,ISNUMBER(SEARCH("Code Red",RDA!$U$2:$U$1048576)*SEARCH($A11,RDA!$B$2:$B$1048576)),0)),"")),"N","Y"))


PDA Sheet

SAMPLE WB.xlsx
ABCDEFGHIJKLMNOPQ
1LinkDocument NoTitleRev NoStatusCriticalLocked ByLock DateLast Rev ByRevision DateReceived DateReview PeriodNext ReviewLock NotesCourse CodeNotesKeywords
2XYZTRUCK FORMINSPECTION, CODE RED, FORM
3FGHWORK INSTRUCTION CHANGE REQUEST AND SIGN OFF FORMCOVER SHEET, CHANGE REQUEST FORM, COD RED
4DFGTRUCK PERFORMANCE REVIEWPA, MOC, FORM
5GHFPROCESS CHANGE REQUEST FORMMOC
PDA


RDA Sheet

SAMPLE WB.xlsx
ABCDEFGHIJKLMNOPQRSTU
1LinkDocument NoTitleRev NoStatusRevision DateReceived DateLast Rev ByReview PeriodNext ReviewLocked ByLock DateEquipment NoLock NotesOwnerDeptVendorVendor Doc NoProject NoNotesKeywords
2ABCTRUCK INSPECTIONINSPECTION, CODE RED
3YUHTRUCK MAINTPA, MOC, FORM
4ZDGPROCESS CHANGE REQUEST FORMMOC
RDA
 
Upvote 0

Forum statistics

Threads
1,223,631
Messages
6,173,464
Members
452,516
Latest member
archcalx

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