# Sumif function using indirect function and data from different sheet

1. ## Sumif function using indirect function and data from different sheet

Hi there from a new user,

I have a spreadsheet with two sheets. The one (called Deb) with all outstanding invoices with ao column G "due date" and column I "invoice amount". The second sheet (called Timeline) gives an overview of the total of the outstanding amounts per due date. Here the due dates are below each other in rows. Before I have been using the formula =SUMIF(Deb!G\$3:G\$148;O5;Deb!I\$3:I\$148) where O5 gives the relevant due date. But since the data in "Deb" is replaced every week G\$148 and I\$148 are not static. Now I want to add the indirect function to make it flexible.

The idea is to use cell P1 and Q1 in tab Timeline to fill in the relevant numbers for Column G (in the example 3 and 148)

I have tried the following formula but it does not work:

=SUMIF(INDIRECT("'Deb'!G"&P1&":G"&Q1;O5;"'Deb'!I"&P1&":I"&Q1))

Any ideas how to do this correct?  Register To Reply

2. ## Re: Sumif function using indirect function and data from different sheet

hi pronky007, welcome to the forum. you need 2 INDIRECT. 1 for the range, 1 for sum_range.
=SUMIF(INDIRECT("Deb!G"&P1&":G"&Q1);O5;INDIRECT("Deb!I"&P1&":I"&Q1))  Register To Reply

3. ## Re: Sumif function using indirect function and data from different sheet

Thanks a bunch, works perfectly!

Egbert  Register To Reply