Vlookup with max formula

Natejack

New Member
Joined
Jun 14, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Trying to figure this out and it’s probably something quite simple.

Layout:

I have a running log of information and events that are entered in with dates and times. From this I have a table using COUNTIFS formulas set to count the number of times certain events take place during each 8 hour shift between a selected start and end date. From this I have a SUM of specific significant events totaled in a list for each shift.

I’m using the formula of:
VLOOKUP(MAX(A1:A15),A1:B15,2,FALSE)

Where A1:A15 are the totals for each event

And B1:B15 are the names of each specific event

The idea is that the formula returns the event that happens the most during each shift during the selected start and end date.

Problem:

The formula does work. However, if there are no events logged, as in all the values are zero, the formula returns the very first event as the most common event for that shift even though the event never took place. Which makes the data a little skewed at first glance to someone that doesn’t know what is actually happening.

I’m trying to figure out a way to have the formula return which event is happening the most during each shift BUT have it return a “no record” or even just a blank cell if all the values are zero.

Any help or a point on the right direction would be greatly appreciated. Thanks in advance
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi & welcome to MrExcel.
How about
Excel Formula:
=let(m,max(a1:a15),if(m=0,"no record",VLOOKUP(m,A1:B15,2,FALSE)))
 
Upvote 0

Forum statistics

Threads
1,223,871
Messages
6,175,099
Members
452,612
Latest member
MESTeacher

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