Sumifs

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
FULL NAMEABS_SHORTFirstLastdaysxxWhoSUM
Person AAL08/01/201809/01/20182 Person A0
Person AAL05/01/201805/01/20181
Person AAL03/01/201804/01/20182


<tbody>

</tbody>
need to put into SUM, the total leave days that are in the future. i.e. yesterday being the 1st, I want the total sum for the person identified. my SUMIFS construction sucks, keep geeting 0 displayed which is obviously wrong
 
Last edited:

Excel Facts

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

Maybe this :

I2 =SUMPRODUCT(--($A$2:$A$4=H2),--($C$2:$C$4>TODAY()),$E$2:$E$4)

ABCDEFGHI
1FULL NAMEABS_SHORTFirstLastdaysxxWhoSUM
2Person AAL08/01/1809/01/182Person A5
3Person AAL05/01/1805/01/181
4Person AAL03/01/1804/01/182

<colgroup><col><col><col><col span="7"></colgroup><tbody>
</tbody>
 
Upvote 0
That worked well, I forget that I need to check that B = AL, due to other codes that maybe pulled and this is only to see booked Annual Leave until year end, from that already taken
 
Upvote 0
Hi Mole,

I was thinking what if the "First" day is in the PAST, but the "Last" day is in the FUTURE as in my sample in Row 5.
Shouldn't the Future days still be added?

If so (and I'm assuming today don't count and we're ONLY counting FUTURE days), I think the easiest way is to add a Helper Column for FUTURE days, otherwise it'll probably need an array formula.

Using SUMIFS without Helper Column, incorrect answer is given:


Book1
ABCDEFGHI
1FULL NAMEABS_SHORTFirstLastdaysxxWhoSUM
2Person AAL08/01/201809/01/20182Person A5
3Person AAL05/01/201805/01/20181
4Person AAL03/01/201804/01/20182
5Person AAL01/01/201803/01/20183
Sheet2
Cell Formulas
RangeFormula
I2=SUMIFS(E2:E4,A2:A4,H2,B2:B4,"AL",C2:C4,">"&TODAY())


With Helper column for FUTURE days:


Book1
ABCDEFGHI
1FULL NAMEABS_SHORTFirstLastTotal daysFuture daysxWhoSUM
2Person AAL08/01/201809/01/201822Person A6
3Person AAL05/01/201805/01/201811
4Person AAL03/01/201804/01/201822
5Person AAL01/01/201803/01/201831
Sheet3
Cell Formulas
RangeFormula
I2=SUMIFS(F2:F5,A2:A5,H2,B2:B5,"AL")
F2=IF(C2),D2-TODAY()-1,D2-C2)+1
 
Last edited:
Upvote 0
Thanks, used without helper this time
 
Upvote 0

Forum statistics

Threads
1,214,638
Messages
6,120,676
Members
448,977
Latest member
moonlight6

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