Excel 2010 - Calculating totals but only on specific rows - VLOOKUP?

Brickinnit

New Member
Joined
Aug 6, 2018
Messages
3
Unit Name
June 2018 Instances
July 2018 Instances
August 2018 Instances
Cost (pounds)
dgfg
1
25
fgdfg
2
30
sfsdf
2
35
sdfsdgdfgfd
3
40
sdfsdf
6
45
sfsdf
3
50
sdfsdfsfdsdf
5
55
dsfsdf
60

<tbody>
</tbody>

Hi Excel Community,

This is the first time I have posted so apologies if any mistakes I did read the posting guide and already searched for a solution but no luck so far - hope you can help :)

Anyway, please see posted table above. I would like to quickly calculate the totals for each month (June, July then August). June total cost would be ((1X25)+(2X35)+(3X50)) = 245 pounds. July would be ((2X30)+(3X40)+(5X55)) = 455 pounds etc. I can obviously do with a simple sum of each total but if have lots of rows, this becomes rather long-winded (for example (=SUM(B3*E3)+(B4*E4) etc etc. Is there an easier way via, for example, VLOOKUP? I tried using combination of VLOOKUP, SUM, PRODUCT etc but couldn't find a way to work.

Hope this makes sense and thanks so much in advance for the help.

Brick
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
For June
=SUMPRODUCT(($E$3:$E$10)*(INDEX($A$3:$E$10,,MATCH(C$1,$A$1:$E$1,0))))
Pull right for other values and adapt ranges as needed
 
Upvote 0
Unit NameJune 2018 InstancesJuly 2018 InstancesAugust 2018 InstancesCost (pounds)
name1125
name2230
name3235
name4340
name5645
name6350
name7555
name860
clip_image001.gif

<tbody>
</tbody>
June 2018 InstancesJuly 2018 InstancesAugust 2018 Instances
245
245 got by
=SUMPRODUCT((B3:B10)*(E3:E10))

<colgroup><col><col><col><col><col span="3"></colgroup><tbody>
</tbody>
 
Upvote 0
There's 2 options.

1) Shift+F9 - this will calculate the current sheet only.
However I've found it sometimes takes longer to calculate the sheet than the whole workbook. That's because (I think!) Excel uses what it calls a calculation tree - a ginormous 'tree' in memory of every calculation in the workbook. To calculate the sheet it has to rebuild that calculation tree to isolate the sheet calculations. The only way to speed it up is to do a 'full rebuild' of the tree (ctrl+Shift+Alt+F9) and then do a series of sheet calculations.

2) VBA - you can build a small macro to only calculate the range you have selected.
https://www.mrexcel.com/forum/excel-questions/11242-calculate-only-specified-range.html

If VBA scares you don't let it. There's a few things to do before you gets started - enable the Develop tab on the ribbon (right click ribbon>Customise the ribbon and check the Developer box on the right. Then record a macro - bottom left of the screen to the right of where it says 'READY' there's an icon of a calculator, click, that opens a dialog box. Change Store macro in to 'personal macro workbook' and hit OK. Then just type something and press return, then press the icon next to ready which will be a white block. Then hit alt-F11 to open the macro editor. Find Personal.xlsb on the left, look in modules and double click Module1.
You should see the macro you created. then copy and paste this :-

Code:
sub calcnow()
Selection.calculate
end sub

Click the save button at the top and close the editor down, then click on the Developer tab, and at top left double click macros. Where you see PERSONAL.XLSB!Calcnow select it, click options and change the shortcut key to a capital E.

Now whenever you have a range selected, press ctrl+E and it will only calculate the cells you have selected.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top