How to write an Excel formula

TechSkill Editorial

TechSkill Blog

October 20, 2026 - 6 min read

Key Takeaways

    To write an Excel formula, select the result cell, type an equals sign and specify which cells the calculation should use. If AI helps you choose a function, give it exact column ranges, a condition and the result you want. Check the suggested formula on a small example before using it in your working spreadsheet.

    Write the calculation rule in one sentence

    For example: “I want to total the quantities of stationery items only.” You have identified the condition, the unit to sum and the records to include. This gives the assistant a clearer task than “calculate this spreadsheet.”

    Excel formulas begin with =. Cell references let you connect the calculation to your data. (source 1).

    On a new worksheet, put headers in row 1 and start the data in row 2. The following fictional learning example uses quantities in units throughout column C. Keep the Georgian category values unchanged when reproducing it.

    Row A: product B: category C: quantity
    2 რვეული საკანცელარიო 4
    3 ყავა სურსათი 2
    4 კალამი საკანცელარიო 6
    5 ჩაი სურსათი 3
    6 საქაღალდე საკანცელარიო 5

    The products are a notebook, coffee, a pen, tea and a folder. The categories are stationery (საკანცელარიო) and groceries (სურსათი). Enter საკანცელარიო in E2 and leave F2 for the result. Do not add a separate column for the row numbers: the table's leftmost column represents Excel's row numbers.

    Which cells should the formula use?

    This task has three parts:

    • B2:B6 contains the categories to check;
    • E2 contains the category to match;
    • C2:C6 contains the corresponding quantities.

    SUMIF works for a sum with one condition. Its general syntax is SUMIF(range, criteria, [sum_range]): the range to check comes first, followed by the criterion and then the range to sum. (source 2).

    For cell F2, the example formula is:

    =SUMIF(B2:B6,E2,C2:C6)
    

    The formula looks for E2's value in column B and adds the numbers in column C only for matching rows. The initial answer should be 15 because 4 + 6 + 5 = 15. The coffee and tea quantities are excluded.

    How should you ask AI for the formula?

    AI can help when you know the calculation rule but cannot remember the function name or argument order. Ask it to explain each cell reference as well as provide the formula.

    Copilot in Excel can suggest and explain formulas. Open Copilot and identify the specific cells. (source 3).

    Access depends on your license and organization settings. Microsoft's current language list includes English but does not list Georgian, so the prompt below is in English. If chat mode is available, request the formula in chat first. (source 4).

    In this worksheet, row 1 contains headers.
    B2:B6 contains categories. C2:C6 contains numeric quantities in units.
    E2 contains the category to match.
    Suggest an Excel formula for F2 that sums C2:C6 only where
    B2:B6 matches E2. Use one criterion and explain each argument.
    Do not translate category values or change the source cells.
    Return the formula and explanation before making any workbook edits.
    

    The request describes the same calculation shown above. If you receive a different answer, check whether it tests your categories and sums the correct quantities. A convincing explanation cannot replace checking the references.

    If you do not have Copilot, you can give the same request and fictional example to an AI chat tool you already have access to. Paste the final formula into Excel and verify the result there. This exercise does not require uploading a complete working file.

    Test the formula with changed inputs too

    One correct answer is not enough. Change the condition and one quantity in a test copy. Restore the original inputs before each independent test.

    Test Change to the original example Expected F2
    Baseline Nothing 15
    Different category Enter სურსათი in E2 5
    Different quantity Change C2 from 4 to 10 21
    No match Enter არარსებული in E2 0

    In the last test, zero means that the category was not found. In a real file, a zero total can mean either no matching records or matching values that sum to zero. If the category must exist, check that separately.

    Enter the numbers in column C as numeric values. If you add more rows, extend both ranges. Row 7, for example, falls outside B2:B6 and C2:C6.

    Why might Excel reject the formula?

    The example uses commas to separate arguments. Your environment may require semicolons. Microsoft documents both separators; the wrong separator can prevent Excel from accepting a formula. (source 5).

    If your Excel uses semicolons, the same formula is written as:

    =SUMIF(B2:B6;E2;C2:C6)
    

    If Excel accepts the formula but the total is wrong, check the category text, extra spaces in cells and the range boundaries. Changing a color or font cannot correct a calculation.

    If the problem is selecting records or handling duplicate rows, use the guide to spreadsheet analysis and checking numbers.

    For a familiar sum, you can write the formula yourself. Use AI when you need help translating a rule into a formula or understanding it. Save the checked formula, its purpose and a small test example so you know what to verify before using it in another spreadsheet.

    Full source addresses

    1. https://support.microsoft.com/en-us/excel/enter-a-formula

    2. https://support.microsoft.com/en-us/excel/functions/sumif-function

    3. https://support.microsoft.com/en-us/excel/copilot/data-insights-with-copilot-in-excel

    4. https://support.microsoft.com/en-us/excel/copilot/frequently-asked-questions-about-copilot-in-excel

    5. https://support.microsoft.com/en-us/excel/how-to-avoid-broken-formulas-in-excel

    Updated: October 20, 2026

    Subscribe to the TechSkill Blog

    Discover where product building is heading next

    Share this post

    By sharing your email, you agree to our Privacy Policy and Terms of Service

    TechSkill

    This content will be available here soon.

    Back to courses