IF then functionality in Libreoffice Calc

is it possible to make a automatic calculation on the basis of a specific word ?

example:
in column 1 are amounts (money)
in column 2 are words (For instance: office, clothing, travel, etc.)
as follows:
column 1:
123.- 100.- 123,- 200,- 250,- etc
column 2:
travel clothing clothing travel office etc.

now i want to calculate the totals of the different amounts based on the words stated in column 2

calculated in a different overview as follows:
Office: all amounts with the word office in column 2
clothing all amounts with the word clothing in column 2
etc…

You could use pivottables:

  • The expenses are the data
  • The categories are the row fields

Click ok, and the pivottable automatically makes the sum per category.