ถามผู้รู้ วิธีการเขียนสูตร excel โดยแปลงจาก VBA ครับ มือใหม่ขอความช่วยเหลือครับ

กระทู้คำถาม
พึ่งจัดทำ ข้อมูลในตาราง Excel  โดยมีข้อมูลพระ สิ่งที่ต้องทำคือการคำนวณหา พรรษา ที่ผ่าน

ตอนนี้ใช้ VBA  ด้วย  =GetPansa(TODAY(),N8)


แต่อยากเปลี่ยนไปใช้สูตรธรรมดา จะได้ใช้นามสกุลธรรมดา ได้ เปิดบนมือถือได้

โค๊ดคือ
Function GetPansa(thinkDate As Date, startDate As Date)

Dim yearP As Double

yearP = Year(thinkDate) - Year(startDate)

If (Month(startDate) > 8) Then
    
    GetPansa = yearP

    If (Month(thinkDate) < 8) Then
    
        GetPansa = yearP - 1
    
    End If
    
    
End If

If (Month(startDate) <= 8) Then
    
    GetPansa = yearP

    If (Month(thinkDate) > 9) Then
    
        GetPansa = yearP + 1
    
    End If
    
End If

End Function

เวลาแปลงเป็นสูตร ต้องเขียนยังไงครับ
แก้ไขข้อความเมื่อ
โปรดศึกษาและยอมรับนโยบายข้อมูลส่วนบุคคลก่อนเริ่มใช้งาน อ่านเพิ่มเติมได้ที่นี่