Here, rate is the discount rate for the period. value1 is the cash flow for the first period, value2 is the cash flow for the second period, and so on until the last period. All the values for a period have to be given as inputs.
Any periods without cash flow should be entered as 0. For example, if the second period has no cash flow, do not use the net cash flow of the third period for value2. You should input value2 as 0, otherwise there will be an error in the final result. Here’s an example in Excel: