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: 9,101
Default IF Function

Below is a start to your results. I don't know enough information about the
current and previous month to finish the macro. How do you determine present
and previous month when there is only one date?


Sub GetResults()

RowCount = 1
Do While Range("A" & RowCount) < ""
Aging = Range("A" & RowCount)
Frequency = Range("B" & RowCount)
AgeofPymt = Range("C" & RowCount)
MyDate = Range("D" & RowCount)
Select Case Aging

Case Is < 60:
Results = "B/P"
Case Is <= 90:
Select Case Frequency
Case "Quarterly", "Annual", "Semi Annual":
Results = "B/P"
Case "Monthly":
Select Case AgeofPymt
Case Is < 61:

End Select

End Select
End Select
Range("E" & RowCount) = Results

RowCount = RowCount + 1
Loop

End Sub


"Ranjit kurian" wrote:

I have four columns, i need a macro to fill my fifth column using IF conditions

The Fist column contains Aging details like 1-30,31-60,61-90,91-180,181-360
and 360, this is always fixed.

The Second column contains Frequency details like Monthly,Quarterly, Semi
Annual, Annual this is always fixed.

The Third column contains Ages of Pymt details, here we have a numbers
begins from 1 till no end, but we have three categories here like =61 or =
blank etc....

The fourth column contains Month details in this formate MMM/YY(Jan/09) (the
months and years are not fixed it can be any month any year)

The Fifth is my result column (Category), i need a macro as explained below

For Aging 1-30 and 31-60 there are no conditions, for these two aging the
fifth cloumn
(Category) result should be B/P

For Aging:61-90, Frequency:Quarterly,Annual,Semi Annual, for these the fifth
cloumn
(Category) result should be B/P

IF the Frequency: Monthly, Age of Pymt : <61,Month: Current month/Previous
month (Jan/09, Dec/08) then the fifth cloumn (Category) result should be B/P

IF the Frequency: Monthly, Age of Pymt : <61,Month: Prior to Current
month/Previous month (Nov/08, Feb/08) then the fifth cloumn (Category)
result should be NB/P

IF the Frequency: Monthly, Age of Pymt : =61 or =blank ,Month: Current
month/Previous month (Jan/09, Dec/08) then the fifth cloumn (Category)
result should be B/NP

IF the Frequency: Monthly, Age of Pymt : =61 or =blank ,Month: Prior to
Current month/Previous month (Nov/08, Feb/08) then the fifth cloumn
(Category) result should be NB/NP

IF the Frequency: Quarterly, Age of Pymt : <121,Month: Current
month/Previous month (Jan/09, Dec/08,Nov/08 take three months) then the fifth
cloumn (Category) result should be B/P

IF the Frequency: Quarterly, Age of Pymt : <121,Month: Prior to Current
month/Previous month (Oct/08, sept/08, Aug/08 take three months) then the
fifth cloumn (Category) result should be NB/P


IF the Frequency: Quarterly, Age of Pymt : =121 or =blank,Month: Current
month/Previous month (Jan/09, Dec/08,Nov/08 take three months) then the fifth
cloumn (Category) result should be B/NP

IF the Frequency: Quarterly, Age of Pymt : =121 or =blank,Month: Prior
Current month/Previous month (Oct/08, sept/08, Aug/08 take three months) then
the fifth cloumn (Category) result should be NB/NP

IF the Frequency: Annual, Age of Pymt : <181,Month: Current month/Previous
month (from current month calculate 12 months Jan/09 till Feb/08) then the
fifth cloumn (Category) result should be B/P

IF the Frequency: Annual, Age of Pymt : <181,Month: Prior to Current
month/Previous month (Jan/08, Dec/07) then the fifth cloumn (Category) result
should be NB/P


IF the Frequency: Annual, Age of Pymt : =181 or =blank,Month: Current
month/Previous month (from current month calculate 12 months Jan/09 till
Feb/08) result should be B/NP

IF the Frequency: Annual, Age of Pymt : =181 or =blank,Month: Prior Current
month/Previous month (Jan/08, Dec/07) then the fifth cloumn (Category) result
should be NB/NP









 
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
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
User Function Question: Collect Condition in Dialog Box - But How toInsert into Function Equation? SteveM Excel Programming 1 January 3rd 08 03:45 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


All times are GMT +1. The time now is 05:33 PM.

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

About Us

"It's about Microsoft Excel"