Dynamic calculations based on Dates

misjonara

New Member
Joined
Mar 26, 2024
Messages
1
Hello everyone!

First of all I'd like to say hello as this is my first post on this forum! I am having a bit of an issue with my spreadsheet. I've created a document that tracks attendance (early leaves, no show etc), and each instance has assigned a letter to a numeric value. As an example if someone's late next to the date and his/hers name you'd see letter "L" and it will add .33 points to their "score"

Here are the instances and their values
M -> .33
L -> .33
E -> .33
A -> 1
T -> 1
N -> 1
PTO -> 0 (I'm adding it here since in the past I had an issue with PTO adding 1 point because of the letter T in it)

My goal for this spreadsheet is to have instances not counted if they occurred over a year ago. Also it is possible that 1 cell can get more than 1 instance. If someone's late and didn't punch I'd insert "M L" and it'd add up to .66.

So far my best formula is =SUMPRODUCT(ISNUMBER(FIND({"M";"E";"L";"A";"N";"T";"PTO"},C5:BL5))*($C$4:$BL$4>=EDATE(TODAY(),-12))*{0.33;0.33;0.33;1;1;1;1}), although it only calculates up to 1 instance per cell...

Any help would be appreciated as I've been stuck on this for some time now...

1711468834524.png
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
My proposition is to:
a) use helper table (for instance in Sheet2)
b) use SUBSTITUTE to change confusing PTO into easily countable P
c) use SEARCH not FIND, because it's not case sensitive
d) use formula similar to your final proposition (but this seems to work correctly on sample data:
Excel Formula:
=SUMPRODUCT(ISNUMBER(SEARCH(Sheet2!$A$1:$A$7,SUBSTITUTE(C5:BL5,"PTO","P")))*Sheet2!$B$1:$B$7*($C$4:$BL$4>=EDATE(TODAY(),-12)))
 

Attachments

  • Zrzut ekranu 2024-03-27 094801.png
    Zrzut ekranu 2024-03-27 094801.png
    17.5 KB · Views: 9
  • Zrzut ekranu 2024-03-27 094728.png
    Zrzut ekranu 2024-03-27 094728.png
    27.3 KB · Views: 11
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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