SUMIF with Multiple Conditions

SaParekh58

New Member
Joined
Feb 20, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I am looking for an equation that will provide an updated projection of labor hours and expenses.
I will use the picture below in this example.
Untitled.png


At the beginning of the week, I scheduled Randall to work 7.5 hours on Sunday, 7.5 hours on Monday, and 9.5 hours on Tuesday (forecasted total hours worked = 24.5).

On Sunday, Randall actualizes 7 hours lowering his overall projected hours by .5 to 24 hours (Sunday 7 actualized hours + Monday 7.5 projected hours +Tuesday 9.5 projected hours)
On Monday, Randall actualizes 9 hours increasing his overall projected hours by 2 to 26 hours (Sunday 7 actualized hours + Monday 9 actualized hours + Tuesday 9.5 projected hours)

I am looking for a formula so that as I enter the day-to-day actualized numbers, my projection will be updated accordingly.

You will notice that I tried to use a "Complete" box to trigger the formula.
The idea was that once I entered the actualized data for that day, I would enter an "X" in the box which would trigger the system to use the actual data from that day and days past and add it to the forecasted hours in the future.

In the example shown, I have entered an "X" for both Sunday and Monday.
So the formula I would need here would account for the following;
Updated Projected Hours = (Actual Hours on Sunday) + (Actual Hours on Monday) + (Forecasted Hours on Tuesday)

Thank you in advance for your time.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Something like:

Book2
ABCDEFGHI
1SundayMondayTuesdayWeekly Totals
2ForecastActualForecastActualForecastActualForecastUpdated Proj.
3NameHoursHoursHoursHoursHoursHoursHoursHours
4Randell7.577.599.524.525.5
5CompletexCompletexComplete
Sheet9
Cell Formulas
RangeFormula
H4H4=B4+D4+F4
I4I4=SUMIF(C5:G5,"",B4:F4)+SUMIF(C5:G5,"X",C4:G4)


This assumes you'll always have "Complete" in the B/D/F cells, otherwise the formula will include some erroneous values. But it's easy enough to adjust if that's not the case. The H2 formula can be adapted if you have more columns. The I4 formula can just look to see if you've entered a value in the C4/E4/G4 cells without need of the X on row 5. But take a look and see if this will work for you, we can tweak it as you want.
 
Upvote 0
SUNMONTUEWEDTHUFRISATWEEKLY TOTALS
FORECASTACTUALFORECASTACTUALFORECASTACTUALFORECASTACTUALFORECASTACTUALFORECASTACTUALFORECASTACTUALFORECASTPROJECTION
Name HoursExpenseHoursExpenseName HoursExpenseHoursExpenseName HoursExpenseHoursExpenseName HoursExpenseHoursExpenseName HoursExpenseHoursExpenseName HoursExpenseHoursExpenseName HoursExpenseHoursExpenseName HoursExpenseHoursExpense
Rosa F5 $ 75.00 0 $ - Rosa F5 $ 75.00 5 $ 75.00 Rosa F $ - 0 $ - Rosa F $ - 0 $ - Rosa F4.5 $ 67.50 0 $ - Rosa F $ - 0 $ - Rosa F $ - 0 $ - Rosa F14.5 $ 217.50 ? $ -
Evelin $ - 4.67 $ 65.38 Evelin $ - 0 $ - Evelin4.5 $ 63.00 5 $ 70.00 Evelin4.5 $ 63.00 0 $ - Evelin $ - 0 $ - Evelin5 $ 70.00 0 $ - Evelin5 $ 70.00 0 $ - Evelin19 $ 266.00 ? $ -
Erick5.5 $ 68.75 5.5 $ 68.75 Erick $ - 0 $ - Erick5.5 $ 68.75 8 $ 100.00 Erick5.5 $ 68.75 0 $ - Erick5.5 $ 68.75 0 $ - Erick $ - 0 $ - Erick5.5 $ 68.75 0 $ - Erick27.5 $ 343.75 ? $ -
Ana $ - 0 $ - Ana $ - 0 $ - Ana4.5 $ 54.00 2 $ 24.00 Ana4.5 $ 54.00 0 $ - Ana $ - 0 $ - Ana $ - 0 $ - Ana $ - 0 $ - Ana9 $ 108.00 ? $ -
10.5 $ 143.75 10.17 $ 134.13 5 $ 75.00 5 $ 75.00 14.5 $ 185.75 15 $ 194.00 14.5 $ 185.75 0 $ - 10 $ 136.25 0 $ - 5 $ 70.00 0 $ - 10.5 $ 138.75 0 $ - 70 $ 935.25 0 $ -
COMPLETEXCOMPLETEXCOMPLETEXCOMPLETECOMPLETECOMPLETECOMPLETE


Thank you for your response.
The version I provided was very modified to what I am actually using, and therefore the formulas did not work.
Rather I uploaded an example that looks more like the spreadsheet I am using.
I am most concerned with the projection of hours, as I can figure out expenses from that.
In this example, I have uploaded the data through Tuesday and want to know what the new projected hours would be provided that the employee sticks to their schedule on all future days.
I also was hoping that the formula would automatically update after I put in actualized data for the next day (ie. for Wednesday).
This is why I added the "Complete" component, hoping to trigger the formula to know that.
The overall projection can be found in the rightmost column.
Thank you again for your help here, as I am completely stumped on how to do this.
 
Upvote 0
Two preliminary comments. First, if you simplify your situation too much, you'll end up getting a response that doesn't work for your real workbook. You should try to include at least a few rows, with all the columns. Next, try to use the XL2BB tool when posting sample sheets. Pasting an image like that does not let the helpers start working on your problem. It took me quite a while to recreate your spreadsheet, and I probably wouldn't have bothered if I hadn't already been working on the problem. XL2BB makes it as easy as click/paste.

On to the problem:

Book2
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAU
1SUNMONTUEWEDTHUFRISATWEEKLY TOTALS
2ForecastActualForecastActualForecastActualForecastActualForecastActualForecastActualForecastActualForecastProjection
3NameHours Expense Hours Expense NameHours Expense Hours Expense NameHours Expense Hours Expense NameHours Expense Hours Expense NameHours Expense Hours Expense NameHours Expense Hours Expense NameHours Expense Hours Expense NameHours Expense Hours Expense
4Rosa F5 $ 75.00 0 $ - Rosa F5 $ 75.00 4 $ 60.00 Rosa F0Rosa FRosa FRosa FRosa FRosa F10 $ 150.00 4 $ 60.00
5Evelin $ - 4.67 $ 65.38 EvelinEvelin4.5 $ 63.00 5 $ 70.00 Evelin4.5 $ 63.00 4 $ 56.00 EvelinEvelinEvelinEvelin9 $ 126.00 13.67 $ 191.38
6Erick5.5 $ 68.75 5.5 $ 68.75 ErickErick5.5 $ 68.75 8 $ 100.00 Erick5.5 $ 68.75 5.5 $ 68.75 ErickErickErickErick16.5 $ 206.25 16.5 $ 206.25
7Ana0 $ - AnaAna4.5 $ 54.00 2 $ 24.00 Ana4.5 $ 54.00 5 $ 60.00 AnaAnaAnaAna9 $ 108.00 9 $ 108.00
810.5143.7510.17 $ 134.13 5 $ 75.00 4 $ 60.00 14.5 $ 185.75 15 $ 194.00 14.5 $ 185.75 14.5 $ 184.75 0 $ - 0 $ - 0 $ - 0 $ - 0 $ - 0 $ - 44.5 $ 590.25 43.17 $ 565.63
9
10CompletexCompletexCompleteCompleteCompleteCompleteComplete
Sheet9
Cell Formulas
RangeFormula
AR4:AS7AR4=SUMPRODUCT(B4:AL4,--(MOD(COLUMN($B4:$AL4),6)=2))
AT4:AU7AT4=SUM(IF(MOD(COLUMN($B4:$AL4),6)=2,IF($B$10:$AL$10="x",D4:AN4,B4:AL4)))
AL8:AO8,AF8:AI8,Z8:AC8,T8:W8,N8:Q8,H8:K8,B8:E8,AR8:AU8AR8=SUM(AR3:AR7)
Press CTRL+SHIFT+ENTER to enter array formulas.


This seems to do the trick. The AR4 formula (which you enter in AR4, then copy it to the rest of AR4:AS7) calculates the weekly totals. The AT4 array formula you enter the same way. It takes the totals from the Forecast columns, unless the X is marked in row 10, then it takes the totals from the Actual columns.
 
Upvote 0
Thank you for the feedback.

I will be sure to do a little better job explaining the next time I need some assistance.
As for the XL2BB tool, I did download the add-in and thought I had submitted the graph using this method.
I am therefore not sure why it didn't upload accordingly.

Thank you for the assistance again.
The formula you sent me did work well and solved my needs.

Have a great night.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,741
Members
449,050
Latest member
excelknuckles

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