Need SUMIF/SUMPRODUCT formula with criteria in non-consecutive columns

sakinahobbes

New Member
Joined
Apr 3, 2019
Messages
1
Excel masters, I need your help! I'm doing a monthly variance analysis and need a year-to-date formula that will calculate only columns that have monthly actuals populated in them. For example, I have 3 columns for each month (actuals/budget/variance) and a total year-to-date at the end (actuals/budget/variance). I don't want to have to adjust the YTD column formulas at the end of each month close, how can I get a formula that will total my 3 columns (actuals/budget/variance) for only the months that have amounts in the "actuals" column.


For example:
19-Jan 19-Jan 19-Jan 19-Feb 19-Feb 19-Feb 19-Mar 19-Mar 19-Mar YTD YTD YTD
GL code Actuals Budget Variance Actuals Budget Variance Actuals Budget Variance Actuals Budget Variance
1111 1000 1000 1000 ? 3000 ?
2222 2000 2000 2000 ? 6000 ?
3333 3000 3000 3000 ? 9000 ?


If I have actuals for both Jan and Feb (but not March as the month hasn't closed yet), what formula would I put in the YTD actuals/budget/variance columns so that it would only include Jan and Feb but not the march budget (3000). Please tell me I do not need a VBA. Thanks in advance!!!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Cells in Either Column O or P (O currently used) determine the Number of Months WITH $$'s.
Other Formulas in YTD are just nested IF Statements contingent on Column O number.



Excel 2010
ABCDEFGHIJKLMNOP
119-Jan19-Jan19-Jan19-Feb19-Feb19-Feb19-Mar19-Mar19-MarYTDYTDYTD# of PeriodsWith DollarsOr
Alternate
Formula
2GLcodeActualsBudgetVarianceActualsBudgetVarianceActualsBudgetVarianceActualsBudgetVariance
31111100010001000?3000100?4000110022
42222200020002000?6000200?80002200
53333300030003000?9000300?120003300

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
L3=IF($O3=1,C3,IF($O3=2,SUM(C3,F3),SUM(C3,F3,I3)))
M3=IF($O3=1,D3,IF($O3=2,SUM(D3,G3),SUM(D3,G3,J3)))
O3=COUNT($C3,$F3,$I3)
P3=COUNTA($C3,$F3,$I3)

<tbody>
</tbody>

<tbody>
</tbody>
 

Watch MrExcel Video

Forum statistics

Threads
1,130,042
Messages
5,639,716
Members
417,107
Latest member
derekMG

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
Top