Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

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

Posted on 2012-04-10
Medium Priority
293 Views
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}))))
``````

Thanks
Massimo

mode-by-year.xlsx
mode-by-year.PNG
0
Question by:Massimo Scola
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2
• 2

LVL 43

Expert Comment

ID: 37827235
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})))),"")
``````
0

Author Comment

ID: 37827558
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
0

LVL 43

Accepted Solution

Saqib Husain, Syed earned 2000 total points
ID: 37829102
Maybe you are not entering this as an array formula. When you enter the formula in the cell press F2 then press shift-ctrl-enter
See attached
Copy-of-mode-by-year-problem.xlsx
0

Author Closing Comment

ID: 37851222
Hello and sorry for my late reply<br />Thanks a lot, it works now.<br /><br />Massimo
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
###### Suggested Courses
Course of the Month4 days, 12 hours left to enroll