Formula to Return Name Based on Values and Dates

BrettOlbrys1

Board Regular
Joined
May 1, 2018
Messages
128
Office Version
  1. 365
Platform
  1. Windows
I have this table and the result I am looking to achieve is to reorder the list based on a date and the values (from highest to lowest). For example, if I want to return the top 3 deals from 3/1/21, I should see my result being:

Column EColumn F
Company 96
Company 74
Company 81

I have a formula (in column F) to order the #'s from greatest to least is: LARGE($B$1:$B$10,ROWS(F$4:$F4))

I then want to return the name of the company in column E that matches the result from column F. But the problem I run into is that if I want it to be based on a specific date, such as 3/1/21, it will still return the first value it finds in the list, so I would get Company 3, Company 1, and Company 2.

How do I get the correct company names, based on a specific date (column C), if there are similar qty's?

Company Name (A)# of Widgets (B)Date (C)
Company 141/1/21
Company 211/1/21
Company 361/1/21
Company 442/1/21
Company 512/1/21
Company 662/1/21
Company 743/1/21
Company 813/1/21
Company 963/1/21
 
You're welcome & thanks for the feedback.
Fluff, I need your help again. Now, instead of filtering on one date, I want to filter on a range of dates. In your formula, where you have C2:C10=F1, I want to be able to have C2:C10>=first date AND C2:C10<final date. I tried to modify your formula with an AND statement, such as:

=INDEX(SORT(FILTER(A2:B10,AND(C2:C10>=F1,C2:C10<G1)),2,-1),SEQUENCE(5),{1,2})

It didn't work, so can you help me out?

Thanks
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
It needs to be like
Excel Formula:
=INDEX(SORT(FILTER(A2:B10,(C2:C10>=F1)*(C2:C10<G1)),2,-1),SEQUENCE(5),{1,2})
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
One last thing, if possible. I have my file which contains lots of sheets (some are dashboards of the data, some are graphs, some are sheets that create relationships between the data, etc.), and one sheet drives everything.

That one sheet is where I import the external data, which then gets pushed to all of the other sheets because of formulas that read the data. That one import file sits on a SharePoint site (which gets updated daily), and I was wondering if there was a way for me to click a button within my Excel file that would grab the file, read the data, and then import it to my data sheet? Basically, I want to automate the process...is this possible and if so, how do I do that?
 
Upvote 0
As that's a totally different question, it needs a new thread. Thanks
 
Upvote 0
As that's a totally different question, it needs a new thread. Thanks
OK, I will ask that in a different thread, but getting back to the latest formula:

=INDEX(SORT(FILTER(A2:B10,(C2:C10>=F1)*(C2:C10<G1)),2,-1),SEQUENCE(5),{1,2})

I want to now return a list of all rows when the total # of widgets is >=100. In the above formula, it limits the rows to (5), so how do I adjust the formula to do this?

Thanks

Brett
 
Upvote 0
You can do that like I originally showed.
 
Upvote 0
You can do that like I originally showed.
Thanks, the issue I have is that the SORT function is returning every column in the data set, but I only want specific columns, not every column. If I had 10 columns of data, and I only wanted columns 1, 3, 6, 7, 9, and 10 as an example, how do I tell it what columns to return instead of every column?
 
Upvote 0
As that is a totally different question, it needs a new thread. Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

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