+ Reply to Thread
Results 1 to 7 of 7

Possible Calculation depending the criterias

  1. #1
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Question Possible Calculation depending the criterias

    Hi,
    My excel table is attached. The areas on the top involved the criterias to get the sum on TOTAL area defined with details on the right. My questions can be summarized as:
    1) How can the data in B3, B4 & B5 auto populated regarding the data below?
    2) How can the sum be auto calculated depending the criterias in B1:B6 considering the broken periods (explained in D7)

    Thanks for kindest promts.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Possible Calculation depending the criterias

    I used Excel tables, Pivot Tables and VBA to develop this application.

    I created a table for the rates on the Rates Sheet. From now on when you need to manage rates, use this table (blue table). You only need to fill in Columns A:I. Column J is calculated automatically. If you change any information on this table, then refresh one of the pivot tables on the pivot table sheet. Since the tables are all made from the same source, refreshing one refreshes them all. You only have to do this when you change data in the green table.

    Likewise, manage the season dates using the orange table. I note that you do not have seasons defined for Nov 1 to Apr 30.

    Columns R and S are "helper columns" that do some intermediate calculations in Excel so I don't have to do them in the code.

    The rates sheet can be hidden whenever you are not making updates to it.

    The pivots sheet may also be hidden. This sheet is used to manage the drop down lists. For example, if you select BED & Breakfast s the Board Type, only Accommodations for Bed & Breakfast will be available for that drop down list. The same logic is used once an accommodation is chosen. The views are limited to that specific accommodation.

    Which brings us back to Sayfa1. You get to fill in the green-shaded cells. The tan-shaded cells are computed automatically.
    - Check-In is limited to May 1 through Oct 31. This value is driven from the orange table on the Rates Sheet.
    - Check-out is limited to check in date through Oct 31.
    - Number of days is calculated from check-in and check-out dates.

    Note: As you make selections, the rate may indicate #N/A. This happens because until you complete all three selections, you may have an invalid combination of Board, Accommodation and Room Type. Once you complete all three selections, you should find the proper rate.

    - Board is limited to the board types in the rates (green) table on the rates sheet. If you add a new type, it will show up on this list automatically.
    - Accommodation type is limited based on the selection made for Board
    - View is limited based on previous two selections.
    - Number of Room is limited to a whole number greater than zero

    Based on your selections, the program calculates the season and looks up the rate. The total is days * rate * number of rooms.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Re: Possible Calculation depending the criterias

    Dear Dflak,
    Thanks for your kindest reply but can not check well because so late here (00:30) will study on it tomorrow. I just made a small test whether being calculated right at broken periods means starting of accommodation in one period and ending in another. So I revise the dates in "Sayfa1" 19.07.2019 to 26.07.2019 for 2ADT+2CHD (03-06)(07-12), BED & BREAKFAST, 1 ROOM accommodation but Rate has picked from Season D only but must be from C & D might be avaluated as: 45*3 nights + 62,5*4 nights= 385 in total but 437,5 is given on table.
    Best regards

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Possible Calculation depending the criterias

    Somehow I got the impression that the rate was based on date of check out. I think I see what you want to do. I'm fairly certain I can make that happen.

  5. #5
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Re: Possible Calculation depending the criterias

    Hi again. As you noticed, calculation must happen in the right periods regarding the dates selection. Once another expert sent me a basic example making the right calculation attached here as well. But it was so basic and the original file is more complicated that all dates are transposed to the top of rates and more criterias needed to provide the true price. However all data in my 1st excel attachment is provided from another workbook by a macro, means transfering the formatted data in an hotel agreement to a nested table as in attachment. Hoping to hear from you soon.
    Attached Files Attached Files

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Possible Calculation depending the criterias

    I think I got it. The only thing I didn't do is extend the logic in case a person stayed more than two seasons. I would think you would want to collect at the end of the second season anyway.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-22-2018
    Location
    Turkey
    MS-Off Ver
    Office2010
    Posts
    84

    Re: Possible Calculation depending the criterias

    Hi. I tested your last file but seems to calculate wrong even in 2 periods. The usual method is not to take the last day into consideration only so the case must be 7 days from C & 3 days from D: (50*7 + 67,5*3)=552,50 * 3 rooms= 1675,50 instead of 1710. If the accommodation is divided into 3 periods each periods must be calculated seperately to reach the right sum. I do not know how to adobt the formula in my file sent yesterday to your copy but making right calculation even in 3 periods can see in attachment with some notes on it. Regards
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculate price depending the criterias & auto populate
    By zrs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-19-2019, 11:58 AM
  2. Automatize calculation of max according several criterias
    By gaudi93080 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-12-2014, 07:52 AM
  3. [SOLVED] sumifs with ranges and criterias depending on an if statement
    By alexcrofut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2014, 04:36 PM
  4. Copying rows from a table to a new workbook depending of criterias
    By OctopusPrime in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-30-2014, 11:43 AM
  5. [SOLVED] Match in VBA depending on two criterias
    By crakter in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-11-2013, 02:48 PM
  6. Extract Datas depending on Criterias
    By Guillaume83 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2011, 05:29 AM
  7. [SOLVED] Sum values depending on prefefined criterias
    By jakees in forum Excel General
    Replies: 3
    Last Post: 04-17-2005, 06:03 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1