Match Index array formula

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,134
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
I am not getting the desired out with this array formula (Column D is phone num, Column G is count, column H is D&C, column J is amount

{=IF((Sheet2!$D$5:$D$800000>=$B$3)*(Sheet2!$G$5:$G$800000<=$D$2)*(Sheet2!$H$2:$H$800000=$B$3&$D$2),Sheet2!$J$5:$J$80000)}

In sheet1 it should search B3 (phonenumber) and D2 (count) and should show the amount.


[TABLE="width: 357"]
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Phon[/TD]
[TD]StID[/TD]
[TD] Country [/TD]
[TD]Count [/TD]
[TD] Phone[/TD]
[TD] CR[/TD]
[TD] Amot[/TD]
[/TR]
[TR]
[TD="align: right"]9768146004[/TD]
[TD="align: right"] 370 [/TD]
[TD] US[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"] 97681460041[/TD]
[TD] XX [/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]5000[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Have tried this array formula,

={INDEX(Sheet2!$J$5:$J$1041149,SMALL(IF(VALUE($B$3&$D$2)=Sheet2!$H$5:$H$1041149,ROW(Sheet2!$H$5:$H$1041149)-MIN(ROW(Sheet2!$H$5:$H$1041149))+1,""""),ROW(A1)))}

It is only giving me 200, but as I drag the formula then it is giving me [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Num]#Num [/URL] error

C3 200 (array formula is working correctly)
C4 [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Num]#Num [/URL] I am not sure is the error because value B3&D3 only once in column H?
C5 [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Num]#Num [/URL]
C6 [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Num]#Num [/URL]
C7 [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Num]#Num [/URL]

Help will be great. Thanks
 
Upvote 0
Would you please provide a 5 row input and the desired output for that input without reference to any formula you might have?
 
Upvote 0
[TABLE="class: cms_table, width: 357"]
<tbody>[TR]
[TD]Phon[/TD]
[TD]StID[/TD]
[TD]Country[/TD]
[TD]Count[/TD]
[TD]Phone[/TD]
[TD]CR[/TD]
[TD]Amot[/TD]
[/TR]
[TR]
[TD="align: right"]9768146004[/TD]
[TD="align: right"]370[/TD]
[TD]US[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]97681460041[/TD]
[TD]XX[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5000[/TD]
[/TR]
</tbody>[/TABLE]



search from col (Phone) Output
97681460041 200 (Cell C1
300 (cell c2)
400 (Cell c3)
5000 (cell c4)


Would you please provide a 5 row input and the desired output for that input without reference to any formula you might have?
 
Last edited:
Upvote 0
I'm sorry I don't follow...



Book1
ABCDEFG
1PhonStIDCountryCountPhoneCRAmot
29768146004370US197681460041XX200
3300
4400
55000
Sheet1


What is the data (input) here and what is the output?
 
Upvote 0
Sheet2 is the data input as table given and output will be if a usr search column E then the output of column G (row 2 to 5) should be available
 
Upvote 0
Search data

[TABLE="width: 405"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Phon[/TD]
[TD]StID[/TD]
[TD]Country[/TD]
[TD]Count[/TD]
[TD]Phone[/TD]
[TD]CR[/TD]
[TD]Amot[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]9768146004[/TD]
[TD]370[/TD]
[TD]US[/TD]
[TD]1[/TD]
[TD]97681460041[/TD]
[TD]XX[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]5000[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]9768149002[/TD]
[TD]370[/TD]
[TD]US[/TD]
[TD]1[/TD]
[TD]9768149001[/TD]
[TD]XX[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]9768130002[/TD]
[TD]370[/TD]
[TD]US[/TD]
[TD]1[/TD]
[TD]9768130002[/TD]
[TD]XX[/TD]
[TD]600[/TD]
[/TR]
</tbody>[/TABLE]


Output Required from column(J) with respect to search

[TABLE="width: 288"]
<colgroup><col><col><col span="2"></colgroup><tbody>[TR]
[TD][/TD]
[TD]Search[/TD]
[TD] [/TD]
[TD]Output[/TD]
[/TR]
[TR]
[TD]User entry[/TD]
[TD="align: right"]97681460041[/TD]
[TD] [/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]300[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]400[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]5000

[/TD]
[/TR]
</tbody>[/TABLE]

current array formula
{=IF((Sheet2!$D$5:$D$800000>=$B$3)*(Sheet2!$G$5:$G$800000<=$D$2)*(Sheet2!$H$2:$H$800000=$B$3&$D$2),Sheet2!$J$5:$J$80000)}
it gives only 1st amount output.


I hope now I am very very clear.
 
Upvote 0
B3 is the user search value (search from column D) and d3 is 1 (search from column G)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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