Nesting "indirect" within "sumifs"
I have a very large spreadsheet with muliple named tabs and multiple named ranges within each tab. I will try to be specific but not long winded... The quick explaination is that I am on a construction project that we have to pay an hourly rate to close lanes. The amount we pay per hour depends on time of day, day of the week, number of lanes closed, and section of the road closed. There is a different tab for each section of road. Within each tab are named ranges (one per column in columns B-Z) that uniquely list the fee amounts by day of the week and number of lanes closed. Time is hourly and is in column A on each tab. I want the user to put in basic information have the spreadsheet do the rest of the work. Once the user indicates all variables the spreadsheet should do a sumifs where it sums a certain range (the start time and end time) in the correct named range on the correct tab. The summary tab has the section of road in column U, the named range in column X, the start time in column P and the end time in column R. I think I need to have something along the lines of
=sumifs(indirect("X6"),indirect("U6")&!A4:A99,"=" &P6,indirect("U6")&!A4:A99,"<="&R6)
It appears the error is in the criteria range. I hope this all makes sense... any ideas?
|