Použitie podmieneného formátovania

Using the menu command Format - Conditional - Condition, the dialog allows you to define conditions per cell, which must be met in order for the selected cells to have a particular format.

Warning Icon

Aby bolo podmienené formátovanie použité, musí byť povolená funkcia Automatický výpočet. Zvoľte Nástroje - Obsah bunky - Automatický výpočet (ak je funkcia povolená, uvidíte vedľa príkazu zaškrtnutie).


Pomocou podmieneného formátovania je možné napríklad zvýrazniť súčty, ktoré presiahnu priemer ostatných súčtov. Ak sa zmenia súčty, formát je automaticky zmenený tiež, bez nutnosti meniť formátovanie ručne.

To Define the Conditions

  1. Vyberte bunky, u ktorých chcete použiť podmienený štýl.

  2. Choose Format - Conditional - Condition.

  3. Enter the condition(s) into the dialog box. The dialog is described in detail in LibreOffice Help, and an example is provided below:

Example of Conditional Formatting: Highlighting Totals Above/Under the Average Value

Step1: Generate Number Values

Určité hodnoty v tabuľke možno zvýrazniť. Napríklad v tabuľke obratov je možné všetky hodnoty nad priemerom zobraziť zelenou a hodnoty pod priemerom červenou. To umožňuje Podmienené formátovanie:

  1. First of all, create a table in which a few different values occur. For your test you can create tables with any random numbers:

    Do bunky napíšte =RAND(), čím dostanete náhodné číslo medzi 0 a 1. Celé čísla medzi 0 a 50 dostanete zápisom =INT(RAND()*50).

  2. Skopírujte vzorec, aby ste dostali riadok náhodných čísel. Potiahnite za pravý dolný roh bunky až sa vytvorí požadovaný počet buniek.

  3. Rovnakým spôsobom potiahnite za pravý dolný roh bunky najviac vpravo, čím vytvoríte ďalšie riadky náhodných čísel.

Step 2: Define Cell Styles

The next step is to apply a cell style to all values that represent above-average turnover, and one to those that are below the average. Ensure that the Styles window is visible before proceeding.

  1. Kliknite na prázdnu bunku a z miestnej ponuky vyberte Formát buniek....

  2. In the Format Cells dialog on the Background tab, click the Color button and then select a background color. Click OK.

  3. In the Styles deck of the Sidebar, click the New Style from Selection icon. Enter the name of the new style. For this example, name the style "Above".

  4. Druhý štýl zadefinujete rovnakým postupom ako prvý, len vyberte inú farbu pozadia a nazvite ho "Pod".

Step 3: Calculate Average

V tomto prípade spočítame priemer náhodných čísel. Výsledok bude v bunke:

  1. Nastavte kurzor do bunky (napr. J14) a vyberte Vložiť - Funkcia....

  2. Select the AVERAGE function. Use the mouse to select all your random numbers. If you cannot see the entire range, because the Function Wizard is obscuring it, you can temporarily shrink the dialog using the Shrink icon.

  3. Close the Function Wizard with OK.

Step 4: Apply Cell Styles

Teraz môžete použiť podmienené formátovanie listu.

  1. Označte všetky bunky s náhodnými číslami ako blok.

  2. Choose the Format - Conditional - Condition command to open the corresponding dialog.

  3. Zadajte túto podmienku: ak je hodnota bunky menšia ako J14, formátujte ju štýlom Pod, ak je hodnota bunky väčšia alebo sa rovná J14, formátujte ju štýlom Nad.

Step 5: Copy Cell Style

Ak chcete neskôr použiť podmienené formátovanie u ďalších bunkách, použite následujúci postup:

  1. Kliknite na jednu z buniek, ku ktorej bolo priradené podmienené formátovanie.

  2. Skopírujte bunku do schránky.

  3. Označte ako blok bunky, ku ktorým chcete priradiť rovnaký typ formátovania.

  4. Choose Edit - Paste Special - Paste Special. The Paste Special dialog appears.

  5. In the Paste area, check only the Formats box. All other boxes must be unchecked. Click OK. Or you can click the Formats only button instead.

Please support us!