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,459
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,084,753
Messages
5,379,658
Members
401,620
Latest member
Ankur Teotia

Some videos you may like

This Week's Hot Topics

  • VBA code giving errors and stopping Excel
    Hello Experts, I have this code being used to loop through files in a file path, and copy specific data to another sheet. It is giving me several...
  • Disable MsgBox message
    Morning, I have a userform where if i leave a ComboBox empty i see a MsgBox warning me that i must enter an invoice number. It is this MsgBox i...
  • Macro Recorder into VBA, Copy Paste Data Filled Cells
    Hi Everyone, I have a macro recorder file that takes a selection of data, copies, then pastes into a new sheet on ("A2:B2") The issue is my...
  • Number format changes while pasting into a cell
    Hi, I am trying to paste a number 180204524303 from an email to an excel cell, however, whenever i try to do so , the the paste value appears as...
  • Collating data
    Hello all. Could someone please help. I am trying to pull all column data from multiple sheets (24 I total so far) into 1 master sheet without...
  • Sum Multiple Columns Based on Multiple Criteria
    I am trying to consolidate data by summing columns G through M based on material, plant, vendor, and fiscal year being identical. The period does...
Top