Return CELL address if If Range greater than TODAY

Tony_Sco

New Member
Joined
Feb 1, 2021
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
I am trying to use the following to find a minimum location within a range "balance" where the "dateRange" is greater than or equal to today.

This formula, but it says I have too many arguments:
=MIN(IF((dateRange>=TODAY()),CELL("address",balance,MATCH(balance,balance,0)))
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Welcome to the MrExcel forum!

I'm not sure why you want the address, if you can get the value by itself. But try this:

Book1
ABCDE
1DateBalanceMin Balance after todayAddress
230-Jan14$B$5
331-Jan2
41-Feb3
52-Feb4
63-Feb5
7
Sheet1
Cell Formulas
RangeFormula
D2D2=AGGREGATE(15,6,balance/(dateRange>TODAY()),1)
E2E2=ADDRESS(AGGREGATE(14,6,ROW(balance)/(balance=D2)/(dateRange>TODAY()),1),COLUMN(balance))
Named Ranges
NameRefers ToCells
balance=Sheet1!$B$2:$B$6D2:E2
dateRange=Sheet1!$A$2:$A$6D2:E2
 
Upvote 0
How about this:

Excel Formula:
=CELL("address",OFFSET(A1:A16,MATCH(SUMPRODUCT(MIN(IF(A1:A16<TODAY(),99999,A1:A16))),A1:A16)-1,0))

I see this is wrong. It's finding the address of the smallest date equal or after today.
 
Upvote 0
Welcome to the MrExcel forum!

I'm not sure why you want the address, if you can get the value by itself. But try this:

Book1
ABCDE
1DateBalanceMin Balance after todayAddress
230-Jan14$B$5
331-Jan2
41-Feb3
52-Feb4
63-Feb5
7
Sheet1
Cell Formulas
RangeFormula
D2D2=AGGREGATE(15,6,balance/(dateRange>TODAY()),1)
E2E2=ADDRESS(AGGREGATE(14,6,ROW(balance)/(balance=D2)/(dateRange>TODAY()),1),COLUMN(balance))
Named Ranges
NameRefers ToCells
balance=Sheet1!$B$2:$B$6D2:E2
dateRange=Sheet1!$A$2:$A$6D2:E2

Welcome to the MrExcel forum!

I'm not sure why you want the address, if you can get the value by itself. But try this:

Book1
ABCDE
1DateBalanceMin Balance after todayAddress
230-Jan14$B$5
331-Jan2
41-Feb3
52-Feb4
63-Feb5
7
Sheet1
Cell Formulas
RangeFormula
D2D2=AGGREGATE(15,6,balance/(dateRange>TODAY()),1)
E2E2=ADDRESS(AGGREGATE(14,6,ROW(balance)/(balance=D2)/(dateRange>TODAY()),1),COLUMN(balance))
Named Ranges
NameRefers ToCells
balance=Sheet1!$B$2:$B$6D2:E2
dateRange=Sheet1!$A$2:$A$6D2:E2
Hi Eric,
That solution works great, incredibly fast reply too... Many thanks!!
The reason I wanted the address is so I can use this macro to goto the cell location in a very long list:

Sub Go_To_Lowest_Balance_Cell()
Application.Goto Sheets("Check Reg_Budget").Range(Sheets("Check Reg_Budget").Range("U3").Value)
End Sub

Tony
 
Upvote 0
Ah, OK! There are other VBA ways to do that without needing the formula, but that works fine. You can also go the other way, and do it on the sheet itself without VBA at all:

Excel Formula:
=HYPERLINK("#'Check Reg_Budget'!"&E2,"Min location")

But of course it depends on what else you've got going on in your workbook.

Anyway, glad we could help! :)
 
Upvote 0
Thanks, I'll try that too!

With you initial solution, I see that it returns the last cell in the column with the lowest amount.
i.e.
$932.77
$1,914.09
$1,603.11
$511.79
$511.79
$511.79
$511.79 < this cell is returned
$2,229.79

I was just wondering why not the first occurrence?
 
Upvote 0
If you want the first occurrence, change the 14 to 15 like this:

=ADDRESS(AGGREGATE(15,6,ROW(balance)/(balance=D2)/(dateRange>TODAY()),1),COLUMN(balance))

The AGGREGATE makes a list of matching rows, then 14 means to take the max row, and 15 means take the minimum row.
 
Upvote 0
Solution
Eric,
You are a true excel magician. Can't thank you enough!!
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

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