Feb 02 2021 12:42 AM
Feb 02 2021 12:42 AM
Attached the sample attendance sheet, I need the attendance list team wise daily and lead wise present data.
|NAME OF EMP||Team||Lead||01||02|
Feb 02 2021 02:19 AM
I need the sum of P for each date ( Team wise and Lead wise)
|NAME OF EMP||Team||Lead||01-Jan||02-Jan||03-Jan||04-Jan||05-Jan|
Feb 02 2021 04:44 AM - edited Feb 02 2021 04:45 AM
I didn't attach the workbook because I didn't know at that stage in the discussion that you could use the XLOOKUP function or the '@' operator. Named Ranges have been around since Excel was first ported to DOS.
Thank you for tidying up after me! Not fair on you though. I once posted on the Chandoo forum that the A1 notation and the practice of copying single-cell relative references were abominations that should never have entered the world of serious computing. I can safely say that it did not meet with overwhelming support and the spreadsheet world and I agreed to part ways.
I am holding off recommending recursive Lambdas as an alternative to the concept of relative referencing though; the latter may be a mess to define but the former is mind-numbingly contorted. There seems to be more to support array processing in the pipeline though.
Feb 02 2021 05:22 AM
@Peter Bartholomew , in general you are right with exhortation to use, I can't say more advanced, but more systematic style of work in Excel. But everything depends on concrete case. If people are more comfortable with with relative/absolute references - why not. On the other hand I remember the case when tried to fix an error in the file with few dozens of named ranges and formulas, and that only for author was obvious what each name means. Spent lot of time with that, I believe with usual references what could be done much faster.
Feb 02 2021 07:51 AM
You have a point. Whereas conventional spreadsheets require the reader to follow each precedent and look for adjacent annotation, names are better understood by referring to the documentation. That begs the question of 'is there any documentation?'
I used to find reading a spreadsheet rather like reading a message written in a Caesar Cipher. The encryption rules are simple enough but it still makes the message difficult to read. My normal process was to decode one reference at a time and name it . By the time I had named every reference, I most likely understood the workbook. What that did not answer, was the question 'given a workbook built from defined names in the first place (where the naming convention might be idiosyncratic), could I do any better? I believe the process is, in essence, to build the missing documentation. For each name, I want to know: what business object does it represent; how it is calculated; what is its intended use; and, less importantly, where are any range references located?
I have a copy of an academic paper which asserts that names are useless as a device for reducing spreadsheet risk. It turned out that the experiments were to test the accuracy with which students could reproduce a series of formulae such as
= PrettyPollyGrossProfit + ThirstyFerretNetProfit
My immediate thoughts were why is one company's gross profit being added to a net profit? Why proliferate Names? Wouldn't the structure of the data be improved by having a defined name, CompanyName, with the individual names as text data values? One then has meaningful relationships between GrossProfit and NetProfit that apply across all companies.
All of which suggests a level of planning that is alien to spreadsheet development. There the strategy is more one of rushing in, getting the job done and sorting the errors later.
Feb 02 2021 02:20 PM
The attached is your problem but the solution uses new methods only available in Excel 365 beta. The recursion required to perform the calculations for each of 31 days as a single calculation is the sort of stuff that fries ones brain so I urge you not to pay it too much attention.
I had to try to fight this one through as a single recursive Lambda function. That it is possible is interesting, but I really struggle getting my senile brain round the challenges of recursion! I am hoping that a future MAP function might make the application of Lambda functions to arrays much easier. Maybe I should take some Python or Haskell training if I am going to get a grip on this. My FORTRAN days do not stand me in good stead!