Forum Discussion

Alecs's avatar
Alecs
Brass Contributor
Dec 17, 2022
Solved

Formula: chose data from different tables based on cell selection

Hello experts,

this one is too complex for me. Need your help

This is a rental spreadsheet that needs to calculate the total amount of money generated. I've created an example file with basic things to make it easier for you to understand what needs to be done. Please open the file and read all information from below in the same time. Here is the content:

- DATA sheet: contains all objects

 

- Sheet1: for selection purposess

* table1: Select DAY = selects admins for each day. One day is divided in two parts: morning and evening. There is a maximum number of two admins that can be selected for the morning part and two for the evening part of the day. So, a maximum number of 4 admins a day.

(you can see in table 1 that I chose: day 1 - morning - admin 1) as an example

** table2: Select LOCATION = here I select the location for day 1 - morning - admin 1. Up to five locations can be selected for each admin.

*** table3: Select PERSON =here I assign the persons for day 1 - morning - admin 1 - location 2 and location 5. Up to five locations can be selected for each admin.

 

I have colored with separated colors those cells that are linked between them across all tables and all sheets to make it easier for you to track them:

 

- Sheet2: for manual data input of the amount of money generated for each location. Each location has two separated tables: morning table and evening table.

 

- TOTAL sheet: calculates all amounts from Sheet2 based on selections from Sheet1

I did a manual calculation example only for DAY 1 and DAY 2 and colored with same colors as in previous Sheets for you to see:

this is how the end result should look like. You can see in cell C3 that all data relevant to admin 1 is colored in "light red"

I have given more details and described each step that the formual should do with screenshots included (see sheet TOTAL)

 

Many thanks in advance!

Alex

 

 

 

 

 

 

 

 

  • Alecs 

    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.

  • mathetes's avatar
    mathetes
    Silver Contributor

    Alecs 

    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.

    • Alecs's avatar
      Alecs
      Brass Contributor
      Hello 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
      • mathetes's avatar
        mathetes
        Silver Contributor

        Alecs 

         

        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)

         

Resources