LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default UDF for Aging in excel - Help needed


Hi,

I am working on an aging formula in excel.
I have date in any cell and if I want to test age, I just use below
excel formula to see the age bracket.

I have managed it in as an array formula in excel but now I need it to
be a UDF.
=LOOKUP(TODAY()-Y2,
{0,7.51,14.51,21.51,30.51,45.51,60.51;"0-7","8-14","15-21","22-30","31-45","46-60","60"})

Below is what I've been trying to do.

Code:
Function AgeBucket(strValue) As String

Dim strValue As Date
Dim Rng As Range
Dim Rng2 As Range

Rng = Array(0, 7.51, 14.51, 21.51, 30.51, 45.51, 60.51)
Rng2 = Array("0-7", "8-14", "15-21", "22-30", "31-45", "46-60", "60")

AgeBucket = Application.WorksheetFunction.Lookup(Today - strValue,
Rng; Rng2)

End Function

Any input is more than welcome.
Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for Aging in excel - Help needed Angela[_2_] Excel Programming 0 July 6th 11 05:40 AM
aging category calculation for open purchase order report in Excel Dan gibbs Excel Worksheet Functions 3 February 7th 09 04:15 AM
Excel for inventory aging? Patrick Excel Worksheet Functions 1 August 23rd 05 08:28 PM
How can I pull and format an SAP aging report into Excel? Pryon Excel Programming 1 April 28th 05 07:51 PM
How to make aging possible in Excel for an age trial balance shee. Anne L Excel Discussion (Misc queries) 3 March 20th 05 05:31 PM


All times are GMT +1. The time now is 06:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"