I'm building a function that uses different formulas based on the DOH of a specific Person in different groups. Some groups may use different formulas depending on the status (if it's active or non-active).
I need the results to be outputted in the Grace Period column, but the grace period column should only have the results for that specific group, and use that group's specific formula.
I also need to take into account that certain groups may use more than one formula depending on status.
ex. Group1 should only output information in the Grace Period column using its own formula and automatically start using Group 2's formula also outputting the results in the Grace Period column. So the formula should change depending on the group name located in column 1.
The formula uses the DOH (the dates located in the column) I want it to output the grace period results without me having to select the specific cell range for them to be outputted
Sub FormTest()
Dim Client As Range
Set Client = Columns(1)
Dim DOH As Range
Set DOH = Columns(4)
Dim Status As Range
Set Status = Column(3)
Dim Group1 As Range
Dim Group2 As Range
Dim Group3 As Range
For Each Client In Group1
If Client.Value = "Group 1" Then
Formula2 = "=DOH+30"
ElseIf Client.Value = "Group 2" Then
Formula2 = "=DOH+60"
ElseIf Client.Value = "Group 3" Then
If Status.Value = "Active" Then
Formula2 = "=DOH+90"
ElseIf Status.Value = "NonActive" Then
Formula2 = "=DOH+30+20"
End If
End Sub