Forum Discussion
Formula: chose data from different tables based on cell selection
- Dec 17, 2022
this one is too complex for me. Need your help
I'm going to speak just for myself, here, but I suspect that others may share the sentiment. That may well be why after nearly 50 views of your appeal for help, you've had no replies. There are many of us here who love to help people (like you) figure out how to get from their raw data to the end product they need.
In your case, the elaborate color coding and multiple sheets actually serves to confuse me (and, I suspect, others). And your verbal descriptions of those sheets adds to the confusion more than it clarifies. (I DO realize you're doing your best to try to make things clear, so please excuse me for questioning what you've done)
I was the director of the HR and payroll database for a major corporation before I retired, so I do have experience dealing with multiple locations, people, pay, etc. You describe this as a "rental spreadsheet" yet at the bottom line (in the TOTAL sheet) it appears more to be about payment to people (Admin 1, 2, etc). I'm hoping you can clarify this apparent discrepancy.
What I'd also like you to do is put the spreadsheet aside. Over there on that table, out of sight.
Now describe in words, words only, what the raw data is (uncalculated) (the Input) (such things as):
- people
- roles
- places
- pay rates (if any, and how related to the above)
- relationships (if any) between Persons and Admins and Locations
- the assignments on Sheet1: you say "done manually" but is the expectation that they'll continue to be selected manually, or are you expecting a computer function or algorithm to make those entries? If so, what are the rules
- what informs the euro amounts that appear in Sheet 2's many boxes (is there an hourly rate somewhere, or does all that get entered as raw data with no table or set of "salaries" or "wages" behind it?)
And then, when all is said and done, what is the desired Output? Is it simply the data in this Sum column,
along with the corresponding identifiers in the Admin column?
Said another way, are all of the intervening columns in "final table: TOTAL" just details, stepping stones on the way to the SUM? Useful backup, perhaps.
I ask all this not to be a pain, but because my sense is that you're getting too far into the weeds too early, trying to design the spreadsheet based on how, say, one might have handled all the moving parts by means of paper ledger sheets. Yes, it IS complex when you lay it all out this way, but if we can step back from the weeds and just look at Input and Output, that might help us come up with simpler ways to handle the intervening steps.
I'm a firm believer in building a solid (and usually fairly simple) database (that's at the input end of things) and then letting Excel work its wonders on that database, adding payments per day per person per location over the period between day 1 and day 14. Excel can do that without visibly arraying the data as you've done--that kind of layout can, and often does, actually interfere with Excel's power to summarize data and produce the Output.
So, for example, a database that simply records, daily (or half-daily)
Date, Who, Where, Amount, (etc, other raw data as needed)
row after row after row
can be summarized by the feature known as the Pivot Table, by person, by day, with totals. Straight from transactional database (Input) to end result (OutPut) all by itself.
If, in other words, it is the case that your sheets 1 and sheet 2 represent raw data, generated on a transactional basis, you don't need to be filling in a ledger sheet (albeit a computerized ledger sheet); just record the raw data in a database or data table. Excel can handle the rest.
Again, forgive me for asking these. If you don't want to engage as I've suggested, that's fine...... I'll defer to others.
this one is too complex for me. Need your help
I'm going to speak just for myself, here, but I suspect that others may share the sentiment. That may well be why after nearly 50 views of your appeal for help, you've had no replies. There are many of us here who love to help people (like you) figure out how to get from their raw data to the end product they need.
In your case, the elaborate color coding and multiple sheets actually serves to confuse me (and, I suspect, others). And your verbal descriptions of those sheets adds to the confusion more than it clarifies. (I DO realize you're doing your best to try to make things clear, so please excuse me for questioning what you've done)
I was the director of the HR and payroll database for a major corporation before I retired, so I do have experience dealing with multiple locations, people, pay, etc. You describe this as a "rental spreadsheet" yet at the bottom line (in the TOTAL sheet) it appears more to be about payment to people (Admin 1, 2, etc). I'm hoping you can clarify this apparent discrepancy.
What I'd also like you to do is put the spreadsheet aside. Over there on that table, out of sight.
Now describe in words, words only, what the raw data is (uncalculated) (the Input) (such things as):
- people
- roles
- places
- pay rates (if any, and how related to the above)
- relationships (if any) between Persons and Admins and Locations
- the assignments on Sheet1: you say "done manually" but is the expectation that they'll continue to be selected manually, or are you expecting a computer function or algorithm to make those entries? If so, what are the rules
- what informs the euro amounts that appear in Sheet 2's many boxes (is there an hourly rate somewhere, or does all that get entered as raw data with no table or set of "salaries" or "wages" behind it?)
And then, when all is said and done, what is the desired Output? Is it simply the data in this Sum column,
along with the corresponding identifiers in the Admin column?
Said another way, are all of the intervening columns in "final table: TOTAL" just details, stepping stones on the way to the SUM? Useful backup, perhaps.
I ask all this not to be a pain, but because my sense is that you're getting too far into the weeds too early, trying to design the spreadsheet based on how, say, one might have handled all the moving parts by means of paper ledger sheets. Yes, it IS complex when you lay it all out this way, but if we can step back from the weeds and just look at Input and Output, that might help us come up with simpler ways to handle the intervening steps.
I'm a firm believer in building a solid (and usually fairly simple) database (that's at the input end of things) and then letting Excel work its wonders on that database, adding payments per day per person per location over the period between day 1 and day 14. Excel can do that without visibly arraying the data as you've done--that kind of layout can, and often does, actually interfere with Excel's power to summarize data and produce the Output.
So, for example, a database that simply records, daily (or half-daily)
Date, Who, Where, Amount, (etc, other raw data as needed)
row after row after row
can be summarized by the feature known as the Pivot Table, by person, by day, with totals. Straight from transactional database (Input) to end result (OutPut) all by itself.
If, in other words, it is the case that your sheets 1 and sheet 2 represent raw data, generated on a transactional basis, you don't need to be filling in a ledger sheet (albeit a computerized ledger sheet); just record the raw data in a database or data table. Excel can handle the rest.
Again, forgive me for asking these. If you don't want to engage as I've suggested, that's fine...... I'll defer to others.
- AlecsDec 17, 2022Brass ContributorHello mathetes
I appreciate your answer. My only wish is to solve this problem and learn more about excel and my personal limitations. It's true, my English is not that good and my verbal description tends to complicate things instead of simplifying them. I'm still young and I'm working to overcome all of these. Thank you for your understanding and please do not feel sorry about asking. I'm open to it.
Moving forward to cover all your points:
Yes, it is a rental application, but the spreadsheet that we are working on is for payment purposes. One of my friends asked me to help him with it. Sheet2 is generated as an exported excel file from an application that they are using for bookings. The application does not allow them to see how much revenue ADMINS generate daily and will take too long to be developed, so, they need this workaround to be done via Excel. Here is a detailed list of terms that I used:
- day = 16 hours divided in two shifts (morning from 08:00 to 16:00 / evening 16:00 to 00:00).
- location = an office that is rented on a daily basis.
- customer = the one that requests the booking.
- person = an employee who talks to the customer and books the location in the application.
- admin = an employee that is supervising all persons.
- manager = an employee that is supervising all admins.
- the euro amounts in Sheet2 = are calculated separately in their application.
_______________________________________________________
This is how the spreadsheet looks like at the moment (same as in my example file). It has two tables for each location: MORNING and EVENING that store all data.
In case you're wondering how data is intended to be updated: they make the export from the application at any given moment => a new excel file will be generated > all Sheet content will be selected + copied > and pasted in our spreadsheet.
There is no algorithm or automated process for our Sheet2 and no expectations in the future.
_______________________________________________________
The desired output is for Managers to know how much revenue each Admin generates daily. This is the most important thing. The SUM column is only for information purposes (total revenue for the 14 days period).
We can change these tables in any way or form so it is easier for us to make it work... Sheet1 is not a must. I tried many approaches but can't get to a result that is close to what is needed.
Please let me know if I missed something.
Best regards,
Alex- mathetesDec 18, 2022Silver Contributor
Thanks for explaining that. I do have at least one more question for now: is it possible for you to post a copy of the exported sheet--the one you get from that other system--just as it comes to you, before you do anything at all to it?
(Unfortunately, my main computer developed a problem this afternoon, so although I have a backup, the main one has the newer functions on it, and two screens. So I'm at a disadvantage when it comes to working on this; I'll do what i can)
- AlecsDec 18, 2022Brass Contributor
Hello
Yes, I can attach the copy. Unfortunately they did not provide the content of the table, so I filled it with the same terminology as in my initial example. The table structure is untouched (rows and columns are in the same place).
As you can see, the first table ranges from A1:AH31. Second table from A3:AH63 and so on. It includes both morning and evening (left and right).
Maximum number of Persons is 30 in each table. Even if a total number of five persons are working, the export will generate all 30 rows (last 25 rows will be empty).
Please note that across all tables PERSON 1 is the same person and will appear always in the first row of each table. I mean that if PERSON 1 is called Maria, the name Maria will appear in the first row of all tables even if it does not have any entries in that table (as seen for example in table 2: rows 34 and 35 are empty).
This export is our starting point.
Let me know what you think. No worries about working on it. Maybe you can only give me some hints about how you would do it and then I can try my best to make it work.
Thank you.