Solved

Excel 07: SUMIF Question

Posted on 2013-01-21
5
367 Views
Last Modified: 2013-01-21
Hi, I am working on a little excel program and have to use the sumif statement.  I am not great with this function, but will provide background information.   I am trying to track leaves of absences at work and for particular employees, they get a certain number of hours per year.  The problem is, the time does not reset at year end, rather it is a 12 month rolling.  So, the manager would enter the starting balance, but I need to calculate the current balance using a 12 months rolling point of view.   To get the check date to see if the hours should count or not, I entered the current date in column Y1 by using the function  =today()   Then below it in Y4, I did a simple =Y1-365.   So essentially, my Y4 is the cutoff date for being greater than or less than a year old

Ideally, I want the sumif statement to take the current balance (G12) and subtract the sum of hours from column C, but only when the date from column B is less than a year old compared to the current date. This is the code I've tried to use and it doesn't work.

=G12-(SUMIF(B18:B70),>Y4,C18:C70)

where:

G12 = starting balance
B18:B70 = Absence dates
C18:C70 =  Absence hours


                                    
      Starting Balance:                        132.4      
      Current Balance:                        124.4      
                                    
                                    
                                    
Date of Absence      Hours Used      comments/Notes                  
1/1/2012                    0                        
2/1/2012            8
0
Comment
Question by:akatz66
5 Comments
 
LVL 24

Expert Comment

by:Steve
ID: 38801791
You likely need to use SUMIFS

Can you provide a sample workbook with dummy data to give a more tailored answer.
0
 
LVL 13

Accepted Solution

by:
Shanan212 earned 250 total points
ID: 38801809
=G12-SUMIF(($B$18:$B$70),">"&(TODAY()-365),$C$18:$C$70)

Open in new window

0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 250 total points
ID: 38801880
You can use Y4 in SUMIF like this

=G12-SUMIF(B18:B70,">"&Y4,C18:C70)

regards, barry
0
 

Author Comment

by:akatz66
ID: 38802075
I've requested that this question be deleted for the following reason:

I was able to figure out the code myself. Thanks!
0
 
LVL 13

Expert Comment

by:Shanan212
ID: 38802076
Could you please post the solution here as well? Thanks!
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel VBA 10 39
New Criteria Prototype 3 18
Dropbox in Windows Server 2008 4 30
Select/Copy row and pasting it lower in sheet 7 19
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question