Forum Discussion
Matthew Merrick
Jan 30, 2018Copper Contributor
SUM function with vlookup referencing the start and stop cells of the range.
I am attempting to write a formula for adding up all the cells within a range using vlookup as the start and stop points of the sum function. The real life description is to add up the containers re...
Mark Fitzgerald
Feb 01, 2018Iron Contributor
VLOOKUP returns a value from a specified number of columns to the right of the found value in the first column of the lookup range. After correcting your formula which was missing a closing bracket, it returns 0 because that's what each of the VLOOKUPs return.
To SUM a range between two dates specified in another column you need one of the conditional sum formulas - SUMIF or SUMIFS. In your case, SUMIFS is needed because you have more than one condition.
=SUMIFS('Cont Rcvd'!B3:B33,'Cont Rcvd'!$A$3:$A$33,">="&Test!$E$4,'Cont Rcvd'!$A$3:$A$33,"<="&Test!$K$4)
The relative referencing of 'Cont Rcvd'!B3:B33 combined with absolute referencing of the Dates in 'Cont Rcvd'!$A$3:$A$33 means the formula can be dragged/filled across row 14 to get numbers for the other items.
- Matthew MerrickFeb 01, 2018Copper Contributor
Outstanding!! Works perfectly!!
Thank you very much.