Match and Match, then vLookup on True, vLookup on False

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
IF
Cell Value(J2) = Cell Value in a Range(A4:A35) AND
Cell Value("ml") = Cell Value in a Range(AX8:AX35), if True, then vlookup, if False, then vlookup.

Here's the formula I have:
=IF(AND(MATCH(J2,'Weekly Picks'!A4:A35,0),(MATCH("ml",'Weekly Picks'!AX8:AX35,0))),VLOOKUP(J2,'Weekly Picks'!$A$4:$C$35,3,0),VLOOKUP(J2,'Weekly Picks'!$A$4:$D$35,4,0))

thank you
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try

=IF(AND(IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0)>0,IFERROR(MATCH("ml",'Weekly Picks'!AX8:AX35,0),0)>0)),VLOOKUP(J2,'Weekly Picks'!$A$4:$C$35,3,0),VLOOKUP(J2,'Weekly Picks'!$A$4:$D$35,4,0))
 
Upvote 0
Try

=IF(AND(IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0)>0,IFERROR(MATCH("ml",'Weekly Picks'!AX8:AX35,0),0)>0)),VLOOKUP(J2,'Weekly Picks'!$A$4:$C$35,3,0),VLOOKUP(J2,'Weekly Picks'!$A$4:$D$35,4,0))
I entered the formula, but received an error. "problem with this formula"
 
Upvote 0
=IF(AND(IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0)>0,IFERROR(MATCH("ml",'Weekly Picks'!AX8:AX35,0),0)>0),VLOOKUP(J2,'Weekly Picks'!$A$4:$C$35,3,0),VLOOKUP(J2,'Weekly Picks'!$A$4:$D$35,4,0))

apologies
 
Upvote 0
Hello,
IF
Cell Value(J2) = Cell Value in a Range(A4:A35) AND
Cell Value("ml") = Cell Value in a Range(AX8:AX35), if True, then vlookup, if False, then vlookup.

Here's the formula I have:
=IF(AND(MATCH(J2,'Weekly Picks'!A4:A35,0),(MATCH("ml",'Weekly Picks'!AX8:AX35,0))),VLOOKUP(J2,'Weekly Picks'!$A$4:$C$35,3,0),VLOOKUP(J2,'Weekly Picks'!$A$4:$D$35,4,0))

thank you
With my results.
It seems everything is True.
It should be 2 True, 2 False.
"ml" is only contained in 2 cells, the rest are blank.
 
Upvote 0
Try breaking it down.

What are these returning?

IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0)
IFERROR(MATCH("ml",'Weekly Picks'!A4:A35,0),0)
 
Upvote 0
With my results.
It seems everything is True.
It should be 2 True, 2 False.
"ml" is only contained in 2 cells, the rest are blank.
I did a COUNTIF-
=COUNTIF('Weekly Picks'!$AX$4:$AX$35,"ml")
results = 2
 
Upvote 0
Well

MATCH("ml",'Weekly Picks'!AX8:AX35,0) should return #N/A error if there's no "ml", so IFERROR(MATCH("ml",'Weekly Picks'!AX8:AX35,0),0) should return 0

0 is not greater than 0 so it should be IF(AND(TRUE,FALSE) which is FALSE.

It's hard to debug if you don't want to break the formula down.
 
Upvote 0
Try breaking it down.

What are these returning?

IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0)
IFERROR(MATCH("ml",'Weekly Picks'!A4:A35,0),0)
Try breaking it down.

What are these returning?

IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0)
IFERROR(MATCH("ml",'Weekly Picks'!A4:A35,0),0)
IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0) = 27
IFERROR(MATCH("ml",'Weekly Picks'!AX4:AX35,0),0) = 4
the bold above is changed to original.
J2="LVR", which will change when scrolled down. The highlighted Purple is the list for J2:J5 range.

Here is what Im working with:

NFL.xlsm
ABCDAX
4ATL2.5
5CAR-2.5
6NE4
7BUF-4WLml
8TEN-6.5WLml
9CIN6.5
10LVR2.5WL
11CLE-2.5
12IND-3
13DET3
14MIN7.5
15GB-7.5
16NYJ19.5
17KC-19.5
18LAR-4
19MIA4
20
21
22NO-4
23CHI4
24SF3
25SEA-3
26DAL
27PHI
28TB-11.5
29NYG11.5
30LAC-3WL
31DEN3
32
33
34
35
Weekly Picks
 
Upvote 0
IFERROR(MATCH(J2,'Weekly Picks'!A4:A35,0),0) = 27
IFERROR(MATCH("ml",'Weekly Picks'!AX4:AX35,0),0) = 4

So both are TRUE what do they return on the ones you expect to be FALSE?
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

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