שיתוף | פונקציות גימטריא לאקסל
-
בניתי שתי פונקציות גימטריה לאקסל 1) פונקצייה הממירה ממספרי לאותיות לדוגמא 253 = רנג 2) פונקציה המחזירה את הגימטריה של טקסט מסוים לדוג' פייתוניסט = 635. בבקשה:
פונקציה 1Function NUM_TO_TXT(X) G = "" TV = Int(X / 400) For I = 1 To TV G = G & "ת" Next I X = X - (TV * 400) TV = Int(X / 300) For I = 1 To TV G = G & "ש" Next I X = X - (TV * 300) TV = Int(X / 200) For I = 1 To TV G = G & "ר" Next I X = X - (TV * 200) TV = Int(X / 100) For I = 1 To TV G = G & "ק" Next I X = X - (TV * 100) TV = Int(X / 90) For I = 1 To TV G = G & "צ" Next I X = X - (TV * 90) TV = Int(X / 80) For I = 1 To TV G = G & "פ" Next I X = X - (TV * 80) TV = Int(X / 70) For I = 1 To TV G = G & "ע" Next I X = X - (TV * 70) TV = Int(X / 60) For I = 1 To TV G = G & "ס" Next I X = X - (TV * 60) TV = Int(X / 50) For I = 1 To TV G = G & "נ" Next I X = X - (TV * 50) TV = Int(X / 40) For I = 1 To TV G = G & "מ" Next I X = X - (TV * 40) TV = Int(X / 30) For I = 1 To TV G = G & "ל" Next I X = X - (TV * 30) TV = Int(X / 20) For I = 1 To TV G = G & "כ" Next I X = X - (TV * 20) TV = Int(X / 10) For I = 1 To TV G = G & "י" Next I X = X - (TV * 10) TV = Int(X / 9) For I = 1 To TV G = G & "ט" Next I X = X - (TV * 9) TV = Int(X / 8) For I = 1 To TV G = G & "ח" Next I X = X - (TV * 8) TV = Int(X / 7) For I = 1 To TV G = G & "ז" Next I X = X - (TV * 7) TV = Int(X / 6) For I = 1 To TV G = G & "ו" Next I X = X - (TV * 6) TV = Int(X / 5) For I = 1 To TV G = G & "ה" Next I X = X - (TV * 5) TV = Int(X / 4) For I = 1 To TV G = G & "ד" Next I X = X - (TV * 4) TV = Int(X / 3) For I = 1 To TV G = G & "ג" Next I X = X - (TV * 3) TV = Int(X / 2) For I = 1 To TV G = G & "ב" Next I X = X - (TV * 2) TV = Int(X / 1) For I = 1 To TV G = G & "א" Next I X = X - (TV * 1) NUM_TO_TXT = G End Function
פונקציה 2
Function TXT_TO_NUM(X) XLEN = Len(X) G = 0 For I = 1 To XLEN XText = Mid(X, I, 1) Select Case XText Case "א" G = G + 1 Case "ב" G = G + 2 Case "ג" G = G + 3 Case "ד" G = G + 4 Case "ה" G = G + 5 Case "ו" G = G + 6 Case "ז" G = G + 7 Case "ח" G = G + 8 Case "ט" G = G + 9 Case "י" G = G + 10 Case "כ", "ך" G = G + 20 Case "ל" G = G + 30 Case "מ", "ם" G = G + 40 Case "נ", "ן" G = G + 50 Case "ס" G = G + 60 Case "ע" G = G + 70 Case "פ", "ף" G = G + 80 Case "צ", "ץ" G = G + 90 Case "ק" G = G + 100 Case "ר" G = G + 200 Case "ש" G = G + 300 Case "ת" G = G + 400 End Select Next TXT_TO_NUM = G End Function
יש ללחוץ באקסל ALT + F11 להוסיף מודול להדביק את הקוד ולשמור וזהו יש לכם את הפונקציה החדשה באקסל
בהצלחה -
-