Skip to main content

๐Ÿงฎ Excel formulas on a Kraaft report

Calculations, IF formulas, hidden sheet: all the techniques to get the most out of Excel in your Kraaft report templates.

Do you want to calculate totals, automate conditions, or display dynamic results in your Kraaft Excel report? It's possible by exporting your reports โ€” and the method depends on the type of field and formula used ๐Ÿงฎ

โ†’ Prerequisite: have a Kraaft Excel report template configured on your report โœ…


๐Ÿ—๏ธ Which reports is this useful for?

Excel templates with formulas are particularly suited to reports that require advanced calculations ๐Ÿ“Š:

  • Timesheet reports โ€” hours worked, overtime, attendance

  • Equipment inventories and stock โ€” quantities, totals, valuation

  • Delivery notes โ€” price calculations, quantities delivered, summaries

  • Site logs โ€” equipment, prices, contractors and staff present, full logistics


๐Ÿ”ข Starting point: Number field or another type?

Formula behaviour depends on the Kraaft field type the tag comes from:

Field type

Exported value

Applicable formulas

Number field

Numeric value

Directly on the cell, no manipulation needed

All others (text, date, time, checkbox...)

Text

Requires conversion via the hidden sheet


๐Ÿ’ก The 2 types of formulas

๐Ÿงฎ Calculation formulas โ€” SUM, +, COUNT...

  • SUM() โ€” recommended for Number fields โœ…

The SUM() formula automatically ignores empty cells and non-numeric values โ€” no error if a field wasn't filled in Kraaft ๐ŸŽ‰

=SUM(B2,B3,B4) โ†’ adds up quantities or amounts
=SUM(B2:B20)   โ†’ total of an entire column
=COUNT(B2:B10) โ†’ counts the number of filled fields
  • Addition with โœš โ€” for text fields containing numbers

Excel automatically converts text to numbers. However, it returns an error if a cell is empty โš ๏ธ โ€” if you use it, make sure empty cells display 0 (that's the role of the hidden sheet explained below).

=B2+B3+B4

โšก๏ธ IF formulas โ€” to replace conditional tags

The conditional tags ##IF## / ##END-IF## don't work in Excel, but Excel's IF formulas let you work around this limitation ๐Ÿ’ก

The structure of an IF formula is always the same:

=IF( condition , value if true , value if false )

Examples:

  • ๐Ÿ“‹ Retrieve a value only if the field is filled โ€” if the cell contains something, display its value; otherwise leave it empty:

    =IF(B2<>"",B2,"")

    โ†’ If B2 is not empty โ†’ displays the value of B2 / Otherwise โ†’ empty cell

  • ๐Ÿท๏ธ Display text based on a cell's content โ€” if the cell contains a specific word, display a label; otherwise display something else:

    =IF(B2="Yes","Validated","Not validated")

    โ†’ If B2 contains exactly "Yes" โ†’ displays "Validated" / Otherwise โ†’ displays "Not validated"


๐Ÿ› ๏ธ The hidden sheet: conversion sheet and calculation draft

For all non-numeric fields, text values must be converted to numbers before they can be used in formulas. The hidden sheet plays this role โ€” it's also a draft sheet to centralise all your logic (calculations, conditions, nested formulas) ๐Ÿ“‹

Typical structure:

Column A

Column B

Column C

Kraaft tags

##date-pointage##

Text or date conversion โ†’ number or special format

(=IF(A2="",0,A2))

Final formulas (SUM, IF...)

based on column B

The main sheet only retrieves the results by pointing to column C.

๐Ÿ‘ฉโ€๐Ÿซ Setup steps:

  1. Create a new sheet in your Excel template (e.g. Calculations) ๐Ÿ—‚๏ธ

  2. Paste your tags in column A

  3. Mirror formula in column B โ€” converts to number, displays 0 if the field is empty:

    =IF(A2="",0,A2)

    โ†’ If A2 is empty: displays 0 (avoids calculation errors) / Otherwise: displays the value of A2

  4. Formulas in column C โ€” calculations or conditions based on column B:

    =SUM(B2,B3)
  5. On the main sheet, point to the result in column C:

    =Calculations!C1
  6. Hide the tab โ€” right-click โ†’ Hide, the hidden sheet does not appear in the PDF shared with your clients ๐Ÿ‘€


๐Ÿ’ก Example: total hours on a timesheet report

Calculations sheet:

A (tags)

B (mirror)

C (total)

##heure##
=IF(A2="",0,A2)
=SUM(B2,B3)
##heure_sup##
=IF(A3="",0,A3)

/

Main sheet: retrieve the total cell โ†’

=Calculations!C1

โš ๏ธ Reminders:

๐Ÿ• Decimal format: Kraaft exports durations in decimal (8h30 = 8.5).

โ†’ Right-click โ†’ Format cells on the result cell to display as [h]:mm or as a number.

๐Ÿ“ค Formulas and calculations do not appear in PDF exports โ€” they only work in Excel exports ๐Ÿ“Š


๐Ÿ’ฌ Need help? Contact our support!

Did this answer your question?