Trying to figure a formula out in Libre Calc, please help.

I am using LibreOffice. I have created a spreadsheet in calc that I need help with. The spreadsheet has four columns. In each column are a series of words. I randomly generate a four word title with the information in each of these columns. Currently there are 4,971,780 different possiblities with 4 columns. The first column has 31 items the second 36 the third 55 and the fourth has 81 items. I used 815536*31=4,971,780 to come up with how many possible answers there are. I need a formula for Calc that will update this formula when I add something new to the column. So a new item is added to column one which has 31 items. It will become row 32. How can I make it so it changes the formula from 31 rows to 32 and so fourth for the other three columns?

Hallo

=PRODUCT(COUNTA(A1:A1000);COUNTA(B1:B1000);COUNTA(C1:C1000);COUNTA(D1:D1000))

Documentation/Calc Functions/COUNTA - The Document Foundation Wiki

Statistical Functions Part One