How to use index and arrays for a nested query?

annechez

New Member
Joined
Apr 11, 2009
Messages
27
Hi,

I have a table as follows:

I am trying to return the latest date for a given Fruit and Type - can anyone help.

i.e. Pear with a Type of AI_646 should return a date of 10/10/2020.

Can anyone help.

I have to use my work version of Excel which is Office 2010, so I can't use the latest features.

Any guidance would be amazing, I'm going round in circles and never coming out with the correct answer!

FruitTypeDate
AppleAI_840
10/03/2020​
PearAI_646
01/03/2020​
PearAI_840
12/12/2020​
AppleAI_121
05/05/2020​
OrangeAI_123
06/06/2020​
PearAI_646
10/10/2020​
PearAI_646
07/09/2020​
 
I'm so close... but my data table sits on one worksheet and I want to do the calculation on another sheet....

I can't get it to work across sheets - do you need to do something special if your data is on a different sheet?
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Okay - I've managed to get to nearly work across sheets....
If I use this it works
=MAX(('H3G-Completed@190620'!B2:B4000="Pear")*('H3G-Completed@190620'!H2:H4000="AI_646")*'H3G-Completed@190620'!V2:V4000)

and if I use the Cell reference it doesn't work..
=MAX(('H3G-Completed@190620'!B2:B4000=B5)*('H3G-Completed@190620'!H2:H4000="AI_646")*'H3G-Completed@190620'!V2:V4000)5

It doesn't work when I replace the "Pear" with cell B5??
Double click to edit B5, i think there will be something invisible there, eg. blanks.
 
Upvote 0
Got it....now.

If the search you are doing can't find a match, how can you get it to leave the cell blank rather than returning a zero (0)?
 
Upvote 0
There are many ways, one way is right click the cell contains formula, format cells, in the first tab, maybe Number, click the last item, type 0;; in the textbox and click OK. I don't have computer around my hand, so above description may not so acurate.
 
Upvote 0
okay - I'm making progress,

But when I use this:
=INDEX(D:D,MOD(MAX((A$2:A$8=F2)*(B$2:B$8=G2)*(C$2:C$8*10^4+ROW(2:8))),10^4))

If it can't find what I'm looking for, it returns the values that in Row 1 for column .

What error handling can I put in place to check if a match for F2 & G2 can't be found in the data, then I can do something else?

Help....
 
Upvote 0

Forum statistics

Threads
1,215,268
Messages
6,123,972
Members
449,137
Latest member
yeti1016

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