Link to home
Start Free TrialLog in
Avatar of Massimo Scola
Massimo ScolaFlag for Switzerland

asked on

How do I calculate the max from two arrays with a year value?

Hello

I have asked a similar question before and need some additional help:

As you can see, there are dates in column A and this time, I'd like to display the favourite shop for, lets say, 2011. What do I need to change to the original formula of

=INDEX(Shop,MODE(IF(Customer=F2,IF(Shop<>"",MATCH(Shop,Shop,0)*{1,1}))))

Open in new window


Thanks
Massimo

User generated imagemode-by-year.xlsx
mode-by-year.PNG
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

If you enter the year number in I1 then you can try this formula

=IFERROR(INDEX(Shop,MODE(IF((Customer=F2)*(YEAR(DateVisited)=$I$1),IF(Shop<>"",MATCH(Shop,Shop,0)*{1,1})))),"")

Open in new window

Avatar of Massimo Scola

ASKER

Hi

I've entered the formula but I get empty cells .. I've attached the spreadsheet.
Did I miss something?

Massimo
mode-by-year-problem.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello and sorry for my late reply<br />Thanks a lot, it works now.<br /><br />Massimo