Qualitative data

Frequency

=COUNTIF(data, condition)

Relative frequency

=COUNTIF(data, condition)/COUNTA(data)

COUNTA(data) will return $n$ (the number of observations).

(For more on COUNTIF() see the tutorial on counting.)

Demo

Quantitative data

For quantitative data you have to first create categories and then enter the array function

={FREQUENCY(data, categories)}

using CTRL+SHIFT+ENTER.

Demo

Cumulative frequency