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!!!
 

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,453
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>
 

Forum statistics

Threads
1,082,243
Messages
5,363,972
Members
400,772
Latest member
solbebe

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top