TheEnergyMan
New Member
- Joined
- Mar 12, 2019
- Messages
- 12
I cant seem to get my head around SUMIFS and VLOOKUP,
Im currently using:
=SUMIF('Gas July'!$B$2:$D$217, VLOOKUP($A3, 'Gas July'!$B$2:$D$217, 1, FALSE), 'Gas July'!$D$2:$D$217)
Which points to a sheet with only July Data and multiple sites and it gives me the number I want (total usage for a particular building), however to save me having multiple tabs I have a main tab with all my years data on it for multiple sites.
I got to:
SUMIF(Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 53, FALSE),Gas!A2:BA4644)
Which Again gives me the total for a site but it gives me the total for all data relating to site "A3"
Ive tried:
=SUMIFs(Gas!BA2:BA4644, Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 1, FALSE), Gas!A2:BA4644, VLOOKUP($B2, Gas!A2:BA4644, 1, FALSE))
Which makes sense to me, as the first Vlookup relates to the site "A3" and the second lookup relates to the month "B2" but all i get is errros and '#VALUE!"
in an attempt to better understand Sumifs i tried putting my sumif statement into a sumifs statement and changing the order of the Criteria, range and SumRange but that also throws out a "#VALUE!"
example:
SUMIF(Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 53, FALSE),Gas!A2:BA4644)
SUMIFS(Gas!A2:BA4644, Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 53, FALSE))
Although Ive moved the Criteria, Criteria Range and Sum range around accordingly it doesnt work?? What am I not understanding here?
Thanks
Im currently using:
=SUMIF('Gas July'!$B$2:$D$217, VLOOKUP($A3, 'Gas July'!$B$2:$D$217, 1, FALSE), 'Gas July'!$D$2:$D$217)
Which points to a sheet with only July Data and multiple sites and it gives me the number I want (total usage for a particular building), however to save me having multiple tabs I have a main tab with all my years data on it for multiple sites.
I got to:
SUMIF(Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 53, FALSE),Gas!A2:BA4644)
Which Again gives me the total for a site but it gives me the total for all data relating to site "A3"
Ive tried:
=SUMIFs(Gas!BA2:BA4644, Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 1, FALSE), Gas!A2:BA4644, VLOOKUP($B2, Gas!A2:BA4644, 1, FALSE))
Which makes sense to me, as the first Vlookup relates to the site "A3" and the second lookup relates to the month "B2" but all i get is errros and '#VALUE!"
in an attempt to better understand Sumifs i tried putting my sumif statement into a sumifs statement and changing the order of the Criteria, range and SumRange but that also throws out a "#VALUE!"
example:
SUMIF(Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 53, FALSE),Gas!A2:BA4644)
SUMIFS(Gas!A2:BA4644, Gas!A2:BA4644, VLOOKUP($A3,Gas!A2:BA4644, 53, FALSE))
Although Ive moved the Criteria, Criteria Range and Sum range around accordingly it doesnt work?? What am I not understanding here?
Thanks
Last edited: