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:
Create a new sheet in your Excel template (e.g. Calculations) ๐๏ธ
Paste your tags in column A
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
Formulas in column C โ calculations or conditions based on column B:
=SUM(B2,B3)
On the main sheet, point to the result in column C:
=Calculations!C1
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!
