Conditional sum if problem

Keith

Registered User.
Local time
Today, 09:25
Joined
May 21, 2000
Messages
129
I am creating a holiday planner. The range A2:C5 in the example below is populated from a user form. The name is selected on the user form using a combo box getting its data from F2:F5. Once the start and end dates are entered on the user form I have code that calculates the number of leave days not counting weekends and bank holidays. An Add button then adds a row to the range A2:D5

The function that I use in G2 is {=SUM(IF(A2:A5=F2,D2:D5))}

On the user form I want to show the number of leave days taken in the current leave year (E2) when the name is selected on the user form. The leave year runs from 1st April until 30th March.
 

Attachments

Last edited:
This is a difficult scenario, you really need the code that counts the number of days holiday to assign the days to the holiday year. Lets say that had been done and placed in H2:H5, then

=SUMPRODUCT((A2:A5=F2)*(H2:H5=E2)*D2:D5)

could be used for your calculation.

Brian

Edit That smiley should have been : D without the space but nodoubt you realised that.
 
Last edited:
Thanks Brian I did notice the smiley. Thanks for your formula it works a treat.
 

Users who are viewing this thread

Back
Top Bottom