Formula request. Text under the sheet.

Guy Boot

New Member
Joined
Apr 24, 2024
Messages
14
Office Version
  1. 2016
Platform
  1. Windows
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
M12XXXXXXXXXXXXXXXXXXXXXXXX
M14XXXXXXXXXXXXXXXXXXXX
A12XXXXXXXXXXXXXXXXXXXXXXXX
A13XXXXXXXXXXXXXXXXXXXXXX
N12XXXXXXXXXXXXXXXXXXXXXXXX
N15XXXXXXXXXXXXXXXXXX
D12XXXXXXXXXXXXXXXXXXXXXXXX
D14XXXXXXXXXXXXXXXXXXXX

The sheet is counting 48 column width and 31 rows down
Column A & B is info from other sheet and is not visible. Here it is only shown to help the programmer
If Column A is M then the crosses start 25 clicks. The crosses from there are the nummer ( here Column B ) multiplied by 2
For example Row 5 ( M 12 ) there are 12h worked in M ( morning ). Resulting 24 crosses counting from 25 cells. IF "C 5" would be the first cell then the crosses start "C5" +24 cells is "AA5"
Figures in column B are the nr of hours worked. All above 12 h should be substracted from the crosses in the sheet. For example Row 19. There are 15 hours worked at night. Is 3 hours les rest resulting 6 crosses les
Resuming.
This is a rest hour sheet. People are working normally 12h. Overtime is given and those have to be substracted from the resttime. Rest time is marked in the sheet with an X on half hour base.
There a 4 shift, counting Morning ( 0:00 to 12:00 ), Afternoon ( 12:00 to 24:00 ), Day ( 06:00 to 18:00 ) And Night ( 18:00 to 06:00 )
Mind there is 1 sheet per person for every month separatly

 
Hi. Its night time here. Any ways, thank you.
Could I send you, one way or another, the workbook, were this sheet is inserted?
All is connected to a data base, which I have problems with to connect.
Please let my know.
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
@Guy Boot @Artik 's code works a treat.
If however you cannot for some reason use a VBA solution then here is a formula possibility.
It's a bit clunky but appears to work?
The limitation of XL2B will only allow me to post a small example.

Cell Formulas
RangeFormula
C5:AX9C5=IF(AND($A5="M",C$1>(2*$B5)),"X",IF(AND($A5="A",C$1<=(48-(2*$B5))),"X",IF(AND($A5="N",C$1>12+2*($B5-12),C$1<=36),"X",IF(AND($A5="D",OR(C$1<=12,C$1>(2*$B5)+12)),"X",""))))
 
Upvote 0
Solution
@Guy Boot @Artik 's code works a treat.
If however you cannot for some reason use a VBA solution then here is a formula possibility.
It's a bit clunky but appears to work?
The limitation of XL2B will only allow me to post a small example.

Cell Formulas
RangeFormula
C5:AX9C5=IF(AND($A5="M",C$1>(2*$B5)),"X",IF(AND($A5="A",C$1<=(48-(2*$B5))),"X",IF(AND($A5="N",C$1>12+2*($B5-12),C$1<=36),"X",IF(AND($A5="D",OR(C$1<=12,C$1>(2*$B5)+12)),"X",""))))
Hi.
Thank you very much. Its working perfect.
@ Artik, IF you have the Macro I am happy to see it. Just leaarning a lot of you both.
 
Upvote 0
Guy Boot,
Please note: When marking a post as the solution, please mark the original post that has the solution and not your own post indicating that another post is the solution.
I have updated this for you.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

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