Use countif then multiple result by vlookup result

DipDip

Board Regular
Joined
Jan 23, 2015
Messages
76
Office Version
  1. 2016
Platform
  1. Windows
Hiya peeps,
So I'm trying to work something out.

In column A I have staff names.
In row 1 I have the days of the week.
Column B is titled Monday
Column C is titled Tuesday and so on.

So say for example in cell B1, I have written down 88 (this means that staff 1, is working 8-8 on Monday. I've done a simple countif then multiple that result to work out how many hours I'm using that day.

Then it got more complicated as other shifts were introduced. 8-7, 8-6. 8-5 etc.

So that was quite easy to do. However now I need to encompass loads more variations. As if a nurse rings in sick and we get cover, but the cover doesn't come in until 10, it might get recorded as 108. (10-8).

The hours are recorded like this so it's easier for the head nurse and head carer to type in the shifts. It's how they've done it for years so I thought it'd be easier to adapt my idea to their way of inputting.

Anyways, I've now come up with loads of different variations. 76 to be exact. So apart from having a really large formula in each total box at the bottom which counts each variation and then multiples it by the number for hours worked that it represents, is there some way I could do this by getting it to look-up this information from a table?

So say on another sheet, I've listed all the different variations and next to it listed how many hours they mean. So the total box on the original sheet checks how many of x there are then multiples it by the vlookup value in the table.

I hope this makes sense.

Cheers in advance for any help.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Do you want to get the sum of hours for each staff member?

If so then assuming shift are shown in B2:H2 for one person and with your list of shifts in Shifts!A2:A77 and associated hours in Shifts!B2:B77 you could use this formula to get the total

=SUMPRODUCT(SUMIF(Shifts!$A$2:$A$77,B2:H2,Shifts!$B$2:$B$77))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,264
Messages
6,123,960
Members
449,135
Latest member
jcschafer209

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