Lookup formula to determine activity use

jmac0027

New Member
Joined
Sep 9, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello,

My excel project is used to track activity based on date. The employee who has the "most days since last use" is given priority when the activity becomes available.
  • The yellow highlighted cell represents the current date.
  • The green highlighted cells calculates how many days it has been since last use. The yellow highlight represents the current date.

LOOKUP(2,1/(D5:P5>0),TODAY() - D2:P2)
The problem with the current formula is that entering data beyond the current date affects outcome. I am hoping someone can suggest a solution that only count from the current date backwards until a "1" is encountered.

I can't use vba or macros.

Thank you!!!


Screen Shot 2024-09-08 at 10.04.48 PM.png

Excel Formula Test.xlsx
ABCDEFGHIJKLMNO
1# Days from current date08/26/2408/27/2408/28/2408/29/2408/30/2408/31/2409/01/2409/02/2409/03/2409/04/2409/05/2409/06/2409/07/24
226272829303101020304050607
3MONTUEWEDTHUFRISATSUNMONTUEWEDTHUFRISAT
4Employee #12111111
5Employee #2511110
6Employee #321111
7Employee #441
8Employee #5111
9Employee #6211111
10Employee #741111
11Employee #831111
12Employee #921111
13Employee #102111
14Employee #113111
Sheet1
Cell Formulas
RangeFormula
B4B4=LOOKUP(2,1/(C4:O4>0),TODAY() - C1:O1)
B5:B6B5=LOOKUP(2,1/(C5:O5>0),TODAY() - C1:O1)
B7B7=LOOKUP(2,1/(C7:O7>0),TODAY() - C1:O1)
B8B8=LOOKUP(2,1/(C8:O8>0),TODAY() - C1:O1)
B9B9=LOOKUP(2,1/(C9:O9>0),TODAY() - C1:N1)
B10B10=LOOKUP(2,1/(C10:O10>0),TODAY() - C1:O1)
B11B11=LOOKUP(2,1/(C11:O11>0),TODAY() - C1:O1)
B12B12=LOOKUP(2,1/(C12:O12>0),TODAY() - C1:O1)
B13B13=LOOKUP(2,1/(C13:O13>0),TODAY() - C1:O1)
B14B14=LOOKUP(2,1/(C14:O14>0),TODAY() - C1:O1)
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Extend dates up to U column. If required to any column and change the formula accordingly.
In B4 copied down.
Excel Formula:
=LOOKUP(2,1/((C4:U4>0)*($C$1:$U$1<=TODAY())),TODAY() - $C$1:$U$1)
 
Upvote 0
Solution
Works great! I modified slightly so current day not included: =LOOKUP(2,1/((C4:U4>0)*($C$1:$U$1<=(TODAY()-1))),(TODAY()-1) - $C$1:$U$1)

Really appreciate your help. I had originally tried XLOOKUP but never got it to work.

Cheers!
 
Upvote 0
Hello I am again seeking the wisdom of the group. The adjacent column to the one listed above sums the range. However, I cannot figure out how to limit the range to the previous 20 days (including current day). Here is the formula I am currently using. =SUMIFS(H5:FD5,H2:FD2, “>=TODAY()-20)

However, it includes the previous 20 days plus everything in future dates. Again, I want to limit to today and 20 days in the past.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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