I need help with maybe custom function for excel.
Everything is in the picture: (Yes, I know that COLOR=YELLOW is nonsense, but its just example of what I think it could solve it).
Basically advanced IF function.
If source cell contains "R" without background color, then make end cell F7 and without background too. However, If source cell contain "R" with yellow background color, then make end cell F7 and with yellow background color too.
Could you help me with that please?
Im not really good at vba, so I wrote something like this:
This is original basic formula:
And this I wrote for VBA code:
Function ExtendedIF (rng As Range) As String If (PSANI[@PO2]="R") And (PSANI[@PO2].Interior.ColorIndex = -4142) Then ExtendedIf = [@Lokace] ElseIf (PSANI[@PO2]="R") And (PSANI[@PO2].Interior.ColorIndex <> -4142 Then ExtendedIF = [@Lokace] And Interior.ColorIndex = RGB (255, 230, 153) Else ExtendedIf = Nothing End If End Function
Could you help me with editing this code to be right please? I dont know how to write correctly those relative ranges.