Linking Cells to Calculate - IF function?

Sambrowne

New Member
Joined
Sep 13, 2016
Messages
46
Office Version
  1. 365
Platform
  1. MacOS
I have a spreadsheet with one sheet that has fixed cells for employee hours and another sheet where I enter leavers and joiners. This latter sheet is not fixed and is free text albeit with drop down occupation codes that are the same between the two sheets. What I want to do is enter a leaver or a joiner on one sheet and have it update the main hours sheet but because the second sheet is effectively free text I can't see how to do it. One cell can't be linked permanently to the other. My gut feeling is through the job codes. So when someone enters leaving hours for UNM (Unit Manager) it links to the other sheet through UNM and updates the hours accordingly. I think this is an IF function but I'm a bit stumped. Thanks!
 

Attachments

  • Sheet 1 - Main.png
    Sheet 1 - Main.png
    17.1 KB · Views: 9
  • Sheet 2 - Free, fixed codes.png
    Sheet 2 - Free, fixed codes.png
    18.6 KB · Views: 10
Okay, that is a simple fix. In the LOOKUP formula, change the end "" to 0.

Excel Formula:
=XLOOKUP($D5&H$4,'Onboarders and Leavers'!$E$5:$E$25&'Onboarders and Leavers'!$F$5:$F$25,'Onboarders and Leavers'!$G$5:$G$25,0)

And with that, you could even take the IFERROR off the other formula if you want.
 
Last edited:
Upvote 1

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I was about to ask exactly that. Wow mate, I think you've nailed it! I'd never have got there, not in a month of Sundays so can't thank you enough. I'm going tp put it all together tomorrow, lock it down where I can and let it loose.

Thanks again, I'd buy you a pint if I could!
 
Upvote 0
Aargh, have discovered a slight glitch. If you see Ser 5 and 6 below both are CAR which would give a total of 60 hours but the formula only takes the first entry - John Smith - and doesn't seem to recognise Jane Doe. When they are pulled through to Ramp Scenarios I can see only 40. any ideas?

Use drop down
SerDateNameJCStatusHoursNoticeLWDStartComments
1
18-Oct-23​
RandomUNMOnboarding
44.00​
2
09-Oct-23​
RandomCHEOnboarding
24.00​
3RandomHRLOnboarding
40.00​
02-Nov-23​
4RandomRALOnboarding
30.00​
02-Nov-23​
5John SmithCAROnboarding
40.00​
6Jane DoeCAROnboarding
20.00​
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
Upvote 0
Okay, we can change the formula to fix that. But now I notice you have two entries on Ramp sheet for CAR, "CAR Days" and "CAR Nights". Both of these would pull in 60 from the 2nd sheet because they both have CAR in JC column (col D). Is this the desired result?

Book1
ABCDEFGHIJK
1
2Ramp Scenarios
3CarebloxUse drop down0
4SerRoleJCR3Ramp + flexContractedOnboardingLeavingRecruitComments
51DMDEP404040000
62Adv Senior CarerADC404000040
73Unit MgrUNM101.25101.2539.754437.555
84SCR DaysSCR315315198.7500116.25171.25
95CAR DaysCAR4624625296020-107
106SCR NightsSCR236.25236.2512200114.25
117CAR NightsCAR2312313086020-117
128MaintenanceMAI37.537.537.5000
139GardenerMAI252500025
1410AdminADM404037.5002.5
1518ReceptionREC777755.50021.5
1611Head ChefHCF404040000
1712Sous ChefSOU404000040
1813Commis ChefCHE252502401
1914Kitchen AsstKIT808080000
2015Head HousekeeperSHO37.537.537.5000
2116Housekeepers and Laundry ConsolidatedHOU12012015100-31
2217HousekeeperHOU62.562.512100-58.5Careblox data includes laundry
2318Laundry AsstLAU5858300028See note above
2419Act CoordHRL38380400-2
2520Act AsstRAL333303003
2621Staff Wellbeing440004
2722DriverDRV141400014
280
2923Totals2036.52036.51676.525877.5179.5
Ramp
Cell Formulas
RangeFormula
H5:I27H5=SUMIFS('Onboarders and Leavers'!$G$5:$G$25,'Onboarders and Leavers'!$E$5:$E$25,$D5,'Onboarders and Leavers'!$F$5:$F$25,H$4)
J22:J27,J5:J20J5=F5+I5-(G5+H5)
K8K8=(J8+J7)
E5E5=IF(E4="","",IF(E4="R1",40,IF(E4="R2",40,IF(E4="R3",40,IF(E4="R4",40,IF(E4="Ramp",0,"Check Entry"))))))
E6E6=IF(E4="","",IF(E4="R1",40,IF(E4="R2",40,IF(E4="R3",40,IF(E4="R4",40,IF(E4="Ramp",0,"Check Entry"))))))
E7E7=IF(E4="","",IF(E4="R1",101.25,IF(E4="R2",101.25,IF(E4="R3",101.25,IF(E4="R4",101.25,IF(E4="Ramp",0,"Check Entry"))))))
E8E8=IF(E4="","",IF(E4="R1",157.5,IF(E4="R2",236.25,IF(E4="R3",315,IF(E4="R4",315,IF(E4="Ramp",0,"Check Entry"))))))
E9E9=IF(E4="","",IF(E4="R1",308,IF(E4="R2",385,IF(E4="R3",462,IF(E4="R4",539,IF(E4="Ramp",0,"Check Entry"))))))
E10E10=IF(E4="","",IF(E4="R1",157.5,IF(E4="R2",236.25,IF(E4="R3",236.25,IF(E4="R4",315,IF(E4="Ramp",0,"Check Entry"))))))
E11E11=IF(E4="","",IF(E4="R1",154,IF(E4="R2",154,IF(E4="R3",231,IF(E4="R4",231,IF(E4="Ramp",0,"Check Entry"))))))
E12E12=IF(E4="","",IF(E4="R1",37.5,IF(E4="R2",37.5,IF(E4="R3",37.5,IF(E4="R4",37.5,IF(E4="Ramp",0,"Check Entry"))))))
E13E13=IF(E4="","",IF(E4="R1",0,IF(E4="R2",25,IF(E4="R3",25,IF(E4="R4",25,IF(E4="Ramp",0,"Check Entry"))))))
E14E14=IF(E4="","",IF(E4="R1",40,IF(E4="R2",40,IF(E4="R3",40,IF(E4="R4",40,IF(E4="Ramp",0,"Check Entry"))))))
E15E15=IF(E4="","",IF(E4="R1",77,IF(E4="R2",77,IF(E4="R3",77,IF(E4="R4",77,IF(E4="Ramp",0,"Check Entry"))))))
E16E16=IF(E4="","",IF(E4="R1",40,IF(E4="R2",40,IF(E4="R3",40,IF(E4="R4",40,IF(E4="Ramp",0,"Check Entry"))))))
E17E17=IF(E4="","",IF(E4="R1",40,IF(E4="R2",40,IF(E4="R3",40,IF(E4="R4",40,IF(E4="Ramp",0,"Check Entry"))))))
E18E18=IF(E4="","",IF(E4="R1",0,IF(E4="R2",25,IF(E4="R3",25,IF(E4="R4",25,IF(E4="Ramp",0,"Check Entry"))))))
E19E19=IF(E4="","",IF(E4="R1",80,IF(E4="R2",80,IF(E4="R3",80,IF(E4="R4",80,IF(E4="Ramp",0,"Check Entry"))))))
E21E21=IF(E4="","",IF(E4="R1",78.5,IF(E4="R2",88.5,IF(E4="R3",120,IF(E4="R4",134,IF(E4="Ramp",0,"Check Entry"))))))
E22E22=IF(E4="","",IF(E4="R1",38.5,IF(E4="R2",48.5,IF(E4="R3",62.5,IF(E4="R4",76.5,IF(E4="Ramp",0,"Check Entry"))))))
E23E23=IF(E4="","",IF(E4="R1",40,IF(E4="R2",40,IF(E4="R3",58,IF(E4="R4",58,IF(E4="Ramp",0,"Check Entry"))))))
E24E24=IF(E4="","",IF(E4="R1",38,IF(E4="R2",38,IF(E4="R3",38,IF(E4="R4",38,IF(E4="Ramp",0,"Check Entry"))))))
E25E25=IF(E4="","",IF(E4="R1",17,IF(E4="R2",17,IF(E4="R3",33,IF(E4="R4",33,IF(E4="Ramp",0,"Check Entry"))))))
E26E26=IF(E4="","",IF(E4="R1",4,IF(E4="R2",4,IF(E4="R3",4,IF(E4="R4",4,IF(E4="Ramp",0,"Check Entry"))))))
E27E27=IF(E4="","",IF(E4="R1",14,IF(E4="R2",14,IF(E4="R3",14,IF(E4="R4",14,IF(E4="Ramp",0,"Check Entry"))))))
F5:F29F5=(E5*$G$3)+E5
E29,G29:J29E29=SUM(E5:E21)+SUM(E24:E27)
 
Upvote 0
Aye, spotted that this morning when I was trying to work out what was going on. I've changed both data validation sets so that they have CAR and CAR(N) and SCR and SCR(N), that should do the trick?
 
Upvote 0
Aye, spotted that this morning when I was trying to work out what was going on. I've changed both data validation sets so that they have CAR and CAR(N) and SCR and SCR(N), that should do the trick?
Yes, just do that or something similar to the other duplicates if you need them to pull separately. (MAI & HOU)
 
Upvote 0
The others are ok but there's still a chance that I will have multiple entries on the Onboarders and Leavers sheet for CAR (and CAR(N )as there are several of those posts in the business and quite often I'll take on two or three at a time. Same goes for SCR and SCR(N).
 
Upvote 0
The others are ok but there's still a chance that I will have multiple entries on the Onboarders and Leavers sheet for CAR (and CAR(N )as there are several of those posts in the business and quite often I'll take on two or three at a time. Same goes for SCR and SCR(N).
Do those changes solve the problem then?
 
Upvote 0
No, it still only pulls through the first entry onto Ramp. Ramp should say 50 for CAR not 20?

Screenshot 2023-11-01 181211.png
Screenshot 2023-11-01 181249.png
 
Upvote 0

Forum statistics

Threads
1,215,108
Messages
6,123,132
Members
449,098
Latest member
Doanvanhieu

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