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
No, that doesn't really help much. The formula I provided should go into cell H5, drag it over to I5, then drag both columns down to the end of your data. If that does not provide the results you are seeking, then we can take another look. I was able to return 44 for line 3 with UNM, but I don't know where you're getting the other values in columns H:I, unless they don't have anything to do with it.
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I can't get it to work at all, I paste it into H5, to drag it across and then I get 'Cannot find "Free, fixed codes". Copy from:' What am I doing wrong?
 

Attachments

  • Screenshot 2023-10-30 at 22.03.18.png
    Screenshot 2023-10-30 at 22.03.18.png
    167.9 KB · Views: 3
Upvote 0
I can't get it to work at all, I paste it into H5, to drag it across and then I get 'Cannot find "Free, fixed codes". Copy from:' What am I doing wrong?
It must be the sheet name then. I assumed "Free, fixed codes" was your sheet name for the second sheet based on your screenshot names. If that is incorrect, change that text in the formula to the name of your second sheet.
 
Upvote 0
D'oh! Ok, got it to work but I had a formula in J5 (=F5+I5-(G5+H5) to net the onboarding/leaving to give me a final figure. If the cells have no data I get a value error. Not sure where to go now? Thanks for your patience and help with this I really appreciate it, I would never have got this far!

Book1.xlsx
ABCDEFGHIJK
2Ramp Scenarios
3CarebloxUse drop down0%
4SerRoleJCR3Ramp + flexContractedOnboardingLeavingRecruitComments
51DMDEP404040  #VALUE!
62Adv Senior CarerADC40400  #VALUE!
73Unit MgrUNM101.25101.2539.754437.555.00
84SCR DaysSCR315315198.75  #VALUE!#VALUE!
95CAR DaysCAR462462529 20#VALUE!
106SCR NightsSCR236.25236.25122  #VALUE!
117CAR NightsCAR231231308 20#VALUE!
128MaintenanceMAI37.537.537.5  #VALUE!
139GardenerMAI25250  #VALUE!
1410AdminADM404037.5  #VALUE!
1518ReceptionREC777755.5  #VALUE!
1611Head ChefHCF404040  #VALUE!
1712Sous ChefSOU40400  #VALUE!
1813Commis ChefCHE2525024 #VALUE!
1914Kitchen AsstKIT808080  #VALUE!
2015Head HousekeeperSHO37.537.537.5  #VALUE!
2116Housekeepers and Laundry ConsolidatedHOU120120151  31.00
2217HousekeeperHOU62.562.5121  #VALUE!Careblox data includes laundry
2318Laundry AsstLAU585830  #VALUE!See note above
2419Act CoordHRL3838040 #VALUE!
2520Act AsstRAL3333030 #VALUE!
2621Staff Wellbeing440  #VALUE!
2722DriverDRV14140  #VALUE!
280
2923Totals2036.52036.51676.513877.5#VALUE!
Ramps
Cell Formulas
RangeFormula
H5:I27H5=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,"")
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)
Cells with Data Validation
CellAllowCriteria
E4ListRamp, R1, R2, R3, R4


Book1.xlsx
BCDEFGHIJK
4SerDateNameJCStatusHoursNoticeLWDStartComments
5122-Sep-23Lady AliceUNMLeaving37.5022-Oct-23
6218-Oct-23Lord BulbousUNMOnboarding44.00tbc
7319-Oct-23Sir ChavCARLeaving20.0020-Oct-23
849-Oct-23Major ****CHEOnboarding24.00
95Mr EggHRLOnboarding40.002-Nov-23
106Mrs FlubRALOnboarding30.002-Nov-23
117
128
139
1410
1511
1612
1713
1814
1915
2016
2117
2218
2319
2420
2521
Onboarders and Leavers
Cells with Data Validation
CellAllowCriteria
E5:E25ListADM, ADC, CAR, CHE, DEP, DRV, HOU, HCF, HRL, KIT, LAU, MAI, MAN, REC, RAL, SCR, SHO, SOU, UNM
F5:F25ListOnboarding, Leaving
 
Upvote 0
You could wrap the J5 formula in IFERROR like this:

Excel Formula:
=IFERROR(F5+I5-(G5+H5),"")
 
Upvote 0
Cheers, that worked - sort of! :unsure: If you look at row 10 on the first sheet (Ramps) there should be 116.25 in there but the LOOKUP has wiped out that formula (even though it's still in the cell) and the IFERROR doesn't resolve it either.
 
Upvote 0
Which row 10 are you referring to? Row 10 for SCR Nights, or SER 10 for Admin?
 
Upvote 0

Forum statistics

Threads
1,215,123
Messages
6,123,181
Members
449,090
Latest member
bes000

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