help with modifying sumif

BrutalLogiC

Active Member
Joined
Feb 26, 2006
Messages
267
Office Version
  1. 2016
Platform
  1. Windows
help I'm trying to write a dynamic formula to produce a result which will change depending on what value I enter in cell B3...

My current formula is:
=SUMIF('Revenue Register'!D:D,G7,'Revenue Register'!M:M)*-1-(SUMIF('Cost Register'!D:D,G7,'Cost Register'!M:M))

but I want to somehow link it to cell B3 so that if I enter a posting period number into B3 it looks at the corresponding data in the revenue and cost sheets.

so if put 8 in cell B3 then the calculation would be the equivalent of (732,940)*-1 minus 486,839 which is 246,061 which is the equivalent of changing the original formula to
=SUMIF('Revenue Register'!D:D,G7,'Revenue Register'!L:L)*-1-(SUMIF('Cost Register'!D:D,G7,'Cost Register'!L:L))

it is to save me manually changing the formula to check different periods..

09.2020 TFM.xlsb
BG
2Posting period:
39
4
5$Project
6
7258,101Project A
8187,514Project B
9176,932Project C
10168,680Project D
11268,482Project E
12136,456Project F
13305,197Project G
Actual vs. Budget


09.2020 TFM.xlsb
DEFGHIJKLMNOP
4Revenue Posting period:
5Project123456789101112
6Project A(732,940)(732,940)(732,940)(732,940)(732,940)(732,940)(732,940)(732,940)(732,940)
7Project B(447,427)(447,427)(447,427)(460,077)(447,427)(447,427)(447,427)(447,427)(447,427)
8Project C(263,253)(263,253)(263,253)(264,058)(263,253)(263,253)(263,253)(263,253)(263,253)
9Project D(222,999)(222,999)(222,999)(222,999)(222,999)(222,999)(222,999)(222,999)(222,999)
10Project E(621,788)(621,788)(621,788)(621,788)(653,988)(621,788)(621,788)(598,455)(598,455)
11Project F(382,875)(432,555)(384,945)(459,580)(380,808)(491,929)(380,805)(386,225)(380,805)
12Project G(491,844)(491,844)(499,434)(493,914)(491,843)(491,844)(491,844)(491,844)(491,844)
Revenue Register


09.2020 TFM.xlsb
DEFGHIJKLMNOP
4Cost Posting period:
5Project123456789101112
6Project A391,350476,717642,750467,143531,403574,002525,788486,879474,839
7Project B248,577260,975273,827285,520271,126270,538218,642252,268259,912
8Project C77,799134,69882,028104,21267,41785,41982,11577,68186,320
9Project D107,82286,01020,85058,10031,99740,68861,10337,27954,319
10Project E285,127286,458276,404281,219291,462342,540340,543358,532329,973
11Project F341,037342,597229,907291,33897,491289,765206,368269,573244,349
12Project G163,056229,932234,013230,680235,537219,402189,763204,338186,647
Cost Register
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How about
Excel Formula:
=SUMIF('Revenue Register'!D:D,G7,INDEX('Revenue Register'!$E:$S,,$B$3))*-1-(SUMIF('Cost Register'!D:D,G7,INDEX('Cost Register'!$E:$S,,$B$3)))
 
Upvote 0
How about
Excel Formula:
=SUMIF('Revenue Register'!D:D,G7,INDEX('Revenue Register'!$E:$S,,$B$3))*-1-(SUMIF('Cost Register'!D:D,G7,INDEX('Cost Register'!$E:$S,,$B$3)))
excellent thanks that works!
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,176
Members
448,948
Latest member
spamiki

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