Tag: Excel Tips India

  • How to Calculate Standard Error of the Mean (SEM) in Excel

    👨‍💼 Meet Rahul – The Interview Story

    Rahul, a recent graduate from Delhi, walks confidently into an Excel data analyst interview at a top MNC. He’s aced formulas like VLOOKUP, IF, and PivotTables.

    But then, the interviewer leans in and asks:

    “Rahul, how do you calculate the Standard Error of the Mean in Excel?”

    Rahul freezes. ❄️
    He remembers hearing about it in statistics class, but Excel? No idea.

    He stammers, “Umm… maybe with AVERAGE()?”

    The interviewer smiles politely and moves on.

    Rahul didn’t get the job.
    But that day, he made a promise to himself — “I’ll never be unprepared again.”


    📚 What is Standard Error of the Mean (SEM)?

    The Standard Error of the Mean (SEM) tells you how much the sample mean (average) is likely to vary from the true population mean.

    🧮 Formula: SEM=Standard Deviationn\text{SEM} = \frac{\text{Standard Deviation}}{\sqrt{n}}SEM=n​Standard Deviation​

    Where:

    • Standard Deviation = spread of the data
    • n = sample size

    ✅ How to Calculate SEM in Excel

    Rahul opens Excel and tries it himself with a dataset of student scores:

    A (Scores)
    80
    85
    90
    88
    92

    🔹 Step 1: Calculate Standard Deviation

    Use:

    excelCopyEdit=STDEV.S(A2:A6)
    

    This gives the sample standard deviation.

    🔹 Step 2: Count the Sample Size

    excelCopyEdit=COUNT(A2:A6)
    

    Returns 5 in this case.

    🔹 Step 3: Combine to Calculate SEM

    excelCopyEdit=STDEV.S(A2:A6)/SQRT(COUNT(A2:A6))
    

    ✅ This is the formula to get Standard Error of the Mean.


    📊 Example Result:

    For the above scores:

    • Standard Deviation ≈ 4.38
    • Count = 5
    • SEM = 4.38 / √5 ≈ 1.96

    🧠 Rahul’s Takeaway

    Next interview, Rahul walks in, confident and ready. When asked again:

    “What’s the SEM in Excel?”

    He smiles and says:

    excelCopyEdit=STDEV.S(range)/SQRT(COUNT(range))
    

    And this time?
    💼 He gets the job.


    📣 Learn More with Practical Excel

    🎓 Join the Mastering MS Excel Course
    From statistics to automation — learn Excel the practical way, just like Rahul.


  • How to Add Quotes Around Numbers or Text in Excel


    🎥 The Problem Begins…

    Meet Aman, a data analyst at a film production house in Mumbai. One fine Monday morning, his boss (let’s call him Kabir, the no-nonsense producer from War) walks in and says:

    “Aman, I need this actor list uploaded to our website, but make sure every name is in double quotes — our software won’t process it otherwise!”

    Aman opens Excel and sees this:

    Actor Name
    Shah Rukh Khan
    Deepika Padukone
    Ranbir Kapoor

    But he needs it to look like this:

    Actor Name (Quoted)
    “Shah Rukh Khan”
    “Deepika Padukone”
    “Ranbir Kapoor”

    😰 Aman panics for a moment… but then remembers his Excel skills💪


    🎯 When Do You Need to Add Quotes?

    You might need quotes:

    • When exporting data for CSV/JSON formats.
    • When uploading content to websites or software tools.
    • When writing formulas or generating coded strings.
    • When automating SMS or WhatsApp messages.

    ✅ Method 1: Using Concatenation Formula

    You can use & to join quotes and cell contents:

    ="""" & A2 & """"
    

    🔍 Breakdown:

    • """" → represents one actual ".
    • A2 → your text or number.
    • Final result: “Shah Rukh Khan”

    ✅ Method 2: Using CONCAT or TEXTJOIN

    If you prefer function-based formulas:

    =CONCAT("""", A2, """")
    

    or

    =TEXTJOIN("", TRUE, """", A2, """")
    

    ✅ Method 3: Apply Quotes to a Range in Bulk

    If you want to process an entire range:

    1. Create a helper column with the formula.
    2. Drag down.
    3. Copy → Paste as Values.
    4. Use “Find & Replace” if needed to remove or adjust quotes.

    ✅ Example with Numbers

    Let’s say Salman Khan’s movies have these budgets:

    Budget (in Cr)
    200
    150
    300

    You want:

    Quoted Budget
    “200”
    “150”
    “300”

    Use the same formula:

    ="""" & A2 & """"
    

    Yes, it works for text, numbers, dates — anything.


    🔥 Bonus: Single Quotes Instead of Double

    Want single quotes (')?

    ="'" & A2 & "'"
    

    📣 Want to Learn More Excel Magic?

    🎓 Join Mastering MS Excel Course
    Learn data cleaning, formula tricks, automation, and real-life use cases like this — with Indian examples and business logic.


    🎬 The Ending?

    Aman sends the file in 2 minutes.
    Kabir looks at it, nods, and says…

    “Mission accomplished, Mr. Excel!”

    Roll credits. 🎞️


  • How to Convert Numbers to Words in Indian Rupees in Excel (With VBA)

    💰 How to Convert Numbers to Words in Indian Rupees in Excel

    Excel doesn’t have a built-in function to convert numbers to words (like “12345” → “Twelve Thousand Three Hundred Forty-Five”) — especially not in the Indian currency format like “Rupees Twelve Thousand Three Hundred Forty-Five Only”.

    But you can achieve this using a custom VBA function.


    ✅ Step-by-Step Guide: Convert Numbers to Words in Indian Rupees


    🧩 Step 1: Open VBA Editor

    1. Press Alt + F11 to open the Visual Basic for Applications (VBA) editor.
    2. Go to Insert > Module.

    ✍️ Step 2: Paste the VBA Code

    Paste the following code into the module window:

    Function ConvertToRupees(ByVal MyNumber)
        Dim Units As String
        Dim SubUnits As String
        Dim TempStr As String
        Dim Rupees As String
        Dim Paise As String
        Dim DecimalPlace As Integer
        Dim Count As Integer
        Dim Place(9) As String
        Dim NumDigit As Integer
        Dim Digit As Integer
        Dim MyNum As String
        Dim DecimalPart As String
        
        Place(2) = " Thousand "
        Place(3) = " Lakh "
        Place(4) = " Crore "
        
        ' Convert MyNumber to string and find position of decimal
        MyNumber = Trim(Str(MyNumber))
        DecimalPlace = InStr(MyNumber, ".")
        
        ' Split rupees and paise
        If DecimalPlace > 0 Then
            Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2))
            MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
        End If
    
        Count = 1
        Do While MyNumber <> ""
            If Count = 1 Then
                TempStr = GetHundreds(Right(MyNumber, 3))
                If Len(MyNumber) > 3 Then
                    MyNumber = Left(MyNumber, Len(MyNumber) - 3)
                Else
                    MyNumber = ""
                End If
            Else
                TempStr = GetTens(Right(MyNumber, 2))
                If Len(MyNumber) > 2 Then
                    MyNumber = Left(MyNumber, Len(MyNumber) - 2)
                Else
                    MyNumber = ""
                End If
            End If
            If TempStr <> "" Then Rupees = TempStr & Place(Count) & Rupees
            Count = Count + 1
        Loop
    
        ConvertToRupees = "Rupees " & Rupees & IIf(Paise <> "", " and " & Paise & " Paise", "") & " Only"
    End Function
    
    Private Function GetHundreds(ByVal MyNumber)
        Dim Result As String
        If Val(MyNumber) = 0 Then Exit Function
        MyNumber = Right("000" & MyNumber, 3)
        If Mid(MyNumber, 1, 1) <> "0" Then
            Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
        End If
        If Mid(MyNumber, 2, 1) <> "0" Then
            Result = Result & GetTens(Mid(MyNumber, 2))
        Else
            Result = Result & GetDigit(Mid(MyNumber, 3))
        End If
        GetHundreds = Result
    End Function
    
    Private Function GetTens(TensText)
        Dim Result As String
        If Val(Left(TensText, 1)) = 1 Then
            Select Case Val(TensText)
                Case 10: Result = "Ten"
                Case 11: Result = "Eleven"
                Case 12: Result = "Twelve"
                Case 13: Result = "Thirteen"
                Case 14: Result = "Fourteen"
                Case 15: Result = "Fifteen"
                Case 16: Result = "Sixteen"
                Case 17: Result = "Seventeen"
                Case 18: Result = "Eighteen"
                Case 19: Result = "Nineteen"
                Case Else
            End Select
        Else
            Select Case Val(Left(TensText, 1))
                Case 2: Result = "Twenty "
                Case 3: Result = "Thirty "
                Case 4: Result = "Forty "
                Case 5: Result = "Fifty "
                Case 6: Result = "Sixty "
                Case 7: Result = "Seventy "
                Case 8: Result = "Eighty "
                Case 9: Result = "Ninety "
                Case Else
            End Select
            Result = Result & GetDigit(Right(TensText, 1))
        End If
        GetTens = Result
    End Function
    
    Private Function GetDigit(Digit)
        Select Case Val(Digit)
            Case 1: GetDigit = "One"
            Case 2: GetDigit = "Two"
            Case 3: GetDigit = "Three"
            Case 4: GetDigit = "Four"
            Case 5: GetDigit = "Five"
            Case 6: GetDigit = "Six"
            Case 7: GetDigit = "Seven"
            Case 8: GetDigit = "Eight"
            Case 9: GetDigit = "Nine"
            Case Else: GetDigit = ""
        End Select
    End Function
    

    🧪 Step 3: Use the Function in Excel

    After saving the VBA code:

    1. Go back to your Excel sheet.
    2. In any cell, enter:
    =ConvertToRupees(123456.78)
    or
    =ConvertToRupees(A2)
    
    *** Here A2 Cell contains numbers
    

    Output:
    Rupees One Lakh Twenty Three Thousand Four Hundred Fifty Six and Seventy Eight Paise Only


    📌 Notes:

    • Works with Indian Numbering System (Thousand, Lakh, Crore).
    • You must enable macros to use this function.
    • Use it in billing templates, invoices, payment receipts, etc.

    📣 Learn More Excel Automation Like This!

    🎓 Join My Excel Mastery Course
    Includes advanced functions, automation using VBA, and business templates with Indian formats.


    ✅ Here is your ready-to-use Excel template to convert numbers to words in Indian Rupees:

    📌 Important:

    This file includes:

    • Sample amounts in column A
    • A formula in column B using =ConvertToRupees(...)
    1. This is Macro enabled file. So you may get the warning. Just enabled the content if you are getting message in yellow and you are good to go.

    Breakdown of Excel VBA Function

    🔹 OVERVIEW OF THE MAIN FUNCTION: ConvertToRupees(ByVal MyNumber)

    This is the main function you call. It takes a numeric value (like 12345.50) and converts it into a full “Rupees … and … Paise” string.


    🔸 STEP 1: Variable Declarations

    vbaCopyEditDim Units As String, SubUnits As String, TempStr As String
    Dim Rupees As String, Paise As String
    Dim DecimalPlace As Integer, Count As Integer
    Dim Place(9) As String
    
    • Rupees: Final string for rupee part.
    • Paise: Final string for decimal part.
    • Place(): Array for Indian numbering system—Thousand, Lakh, Crore, etc.
    • Count: Keeps track of digit positions (units, thousands, lakhs…).
    • TempStr: Stores interim word values as they’re built.
    vbaCopyEditPlace(2) = " Thousand "
    Place(3) = " Lakh "
    Place(4) = " Crore "
    

    🔸 STEP 2: Handle Decimal and Integer Split

    vbaCopyEditMyNumber = Trim(Str(MyNumber))
    DecimalPlace = InStr(MyNumber, ".")
    
    • Converts the number to string, and finds the position of the decimal point (if it exists).
    • For example, 12345.50 becomes:
      • Rupee part: 12345
      • Paise part: 50
    vbaCopyEditIf DecimalPlace > 0 Then
        Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2))
        MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))
    End If
    
    • Extracts the paise part using the GetTens function (explained later).
    • Ensures at least 2 digits by appending "00" and trimming.

    🔸 STEP 3: Main Loop to Build Words for Rupee Part

    vbaCopyEditCount = 1
    Do While MyNumber <> ""
    
    • Processes the rupee part in blocks of 3 or 2 digits, depending on the Indian number system.
    vbaCopyEditIf Count = 1 Then
        TempStr = GetHundreds(Right(MyNumber, 3))
    
    • First time, take the last 3 digits (i.e., units, tens, hundreds).
    vbaCopyEditElse
        TempStr = GetTens(Right(MyNumber, 2))
    
    • From second iteration onwards, take 2 digits at a time (i.e., thousands, lakhs, crores).
    vbaCopyEditIf TempStr <> "" Then Rupees = TempStr & Place(Count) & Rupees
    Count = Count + 1
    
    • Adds the word form to Rupees, prepending appropriate place name.

    🔸 STEP 4: Final Formatting

    vbaCopyEditConvertToRupees = "Rupees " & Rupees & IIf(Paise <> "", " and " & Paise & " Paise", "") & " Only"
    
    • Constructs the final string like:
      “Rupees Twelve Thousand Three Hundred Forty Five and Fifty Paise Only”

    🔹 SUPPORTING FUNCTIONS

    🔸 GetHundreds(MyNumber)

    • Converts a 3-digit number into words.
    • Example: "345" → "Three Hundred Forty Five"
    vbaCopyEditMyNumber = Right("000" & MyNumber, 3)
    
    • Pads numbers like "45" to "045" for consistent processing.
    vbCopyEditIf Mid(MyNumber, 1, 1) <> "0" Then
        Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred "
    
    • If the hundred’s digit is not zero, convert it (e.g., 3 → “Three Hundred”).
    vbaCopyEditIf Mid(MyNumber, 2, 1) <> "0" Then
        Result = Result & GetTens(Mid(MyNumber, 2))
    Else
        Result = Result & GetDigit(Mid(MyNumber, 3))
    End If
    
    • Handles the remaining 2 digits using GetTens.

    🔸 GetTens(TensText)

    • Converts 2-digit numbers to words.
    • Example: "45" → "Forty Five", "19" → "Nineteen"
    vbaCopyEditIf Val(Left(TensText, 1)) = 1 Then
        Select Case Val(TensText)
            Case 10: Result = "Ten"
            Case 11: Result = "Eleven"
            ...
    
    • Handles special case of numbers from 10 to 19.
    vbaCopyEditElse
        Select Case Val(Left(TensText, 1))
            Case 2: Result = "Twenty "
            Case 3: Result = "Thirty "
            ...
    
    • Handles the tens place (20, 30, 40…).
    vbaCopyEditResult = Result & GetDigit(Right(TensText, 1))
    
    • Adds the unit place digit (e.g., 4 in 34).

    🔸 GetDigit(Digit)

    • Converts a single digit to its word form.
    • E.g., 1 → "One", 9 → "Nine"

    🔚 SUMMARY FLOW

    mathematicaCopyEditInput → "12345.50"
    ↓
    Split to "12345" (Rupees) and "50" (Paise)
    ↓
    Break into 3-2-2: 12 (Thousand), 345
    ↓
    → "Twelve Thousand Three Hundred Forty Five"
    → "Fifty Paise"
    ↓
    Output → "Rupees Twelve Thousand Three Hundred Forty Five and Fifty Paise Only"
    

    Best selling products

  • How to Add Country or Area Code to Phone Numbers in Excel

    📞 How to Add Country/Area Code to a Phone Number List in Excel – With Example

    Adding a country code or area code to phone numbers in Excel is a common task in data cleaning and formatting. It’s especially useful when preparing lists for international communication, WhatsApp campaigns, or CRM uploads.


    ✅ Example Scenario: Add +91 Country Code to Indian Mobile Numbers

    Let’s say you have a list of mobile numbers in Column A (without country code):

    A (Mobile No.)
    9876543210
    9123456789
    9988776655

    Your goal is to add +91 before each number.


    🔹 Method 1: Using Formula

    Use the CONCATENATE or & operator:

    ="+91" & A2
    

    Or:

    =CONCAT("+91", A2)
    

    Result:

    B (With +91)
    +919876543210
    +919123456789
    +919988776655

    ➡️ Drag the formula down to apply it to all rows.


    🔹 Method 2: For Area Codes (e.g., Delhi’s Landline ‘011’)

    If you have landline numbers and want to prefix them with area code:

    A (Landline)
    23456789
    87654321

    Formula:

    ="011" & A2
    

    Result:

    B (With Area Code)
    01123456789
    01187654321

    🔹 Method 3: Add Country Code Only If Missing (Advanced)

    Use IF to avoid adding code to already-formatted numbers:

    =IF(LEFT(A2, 3)="+91", A2, "+91" & A2)
    

    This checks if +91 already exists and avoids duplication.


    🔒 Important Notes:

    • Excel treats numbers starting with + as text. No need to format them as numbers.
    • Format the column as Text before pasting or using the formula to prevent Excel from removing leading zeroes or the +.

    📣 Promote Your Excel Course

    Want to learn more data cleaning tricks like this?

    🎓 Join the Excel Mastery Course
    Learn with real-world examples, Indian data sets, and career-focused Excel training.