+ Reply to Thread
Results 1 to 20 of 20

Get a value based on 3 conditions

  1. #1
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Question Get a value based on 3 conditions

    Hi guys,

    New to the forum and desperate to get something done. :D

    Due to some manual calculations having gone wrong here at the office, i'm now under pressure to make sure the same mistake never happens again.

    Basicaly, the way to achieve this is by automating it and making it less prone to human mistake.

    I have a table of properties for rent. and the price is calculated based on each individual property and the time of the year the house is being ocupied.

    basicaly, something like this (the prices are weekly):



    Property Period 1 Period 2 Period 3
    01-01-2013 to 22-03-2013 23-03-2013 to 12-04-2013 13-04-2013 to 07-06-2013

    A 1,500.00 € 1,600.00 € 1,650.00 €
    B 1,115.00 € 1,200.00 € 1,475.00 €
    C 775.00 € 1,050.00 € 1,200.00 €



    and so on...
    total amount of properties = 50
    Total amount of periods = 8


    The ideal way would be:

    User inserts start and end dates, house ID in the correspondent cells... and Excel returns the total value of the booking. Is this doable?
    Have to keep in mind that the prices are weekly but most likely will have to be changed to daily... reason being that if a booking overlaps periods, the different prices have to be calculated (lets say a booking of 7 days, where 3 days are on period 1 and the remaining 4 on period 2, final price needs to be calculated accordingly.

    Thanks in advance on any help you can provide.

    Sample data.xlsx
    Last edited by Halekx; 12-19-2013 at 07:39 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    Can you provide a sample workbook, rather than contributors setting it up from scratch? To attach a file to one of your posts, click on Go Advanced whilst in Edit mode and scroll down to Manage Attachments, then click on Add Files | Select Files, then navigate to your file and double-click it, then click on Upload Files | Done and finally click on Submit Post.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Thanks for that Pete... Done

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    If you are working things out by days, you need to consider if your booking dates are inclusive of the start and end dates, i.e. if someone books from 23rd March to 30th March, is that 7 days or 8 ?

    Pete

  5. #5
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Hi Pete... we work by slept night... that example would be 7 nights

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    Okay, another question: someone wants to book for one night, from 22nd March to 23rd March - which period would that one night fall into?

    Pete

  7. #7
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    We have a minimum booking period of 7 nights... but for the calculation purposes, it would still fall into the 1st period.

  8. #8
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    anyone able to help, please? at least pointing me in the right direction...

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    I did a bit of work on this last week, and then forgot about it as I had people to stay over the weekend. I would suggest splitting the days booked into a number of consecutive periods (probably 3 would be enough to cover long bookings), and then multiply the days by the rate in each period. It might be better to do this in a separate worksheet, so that you have one for bookings and one for the various prices.

    You said that you have 8 pricing periods, but the example you posted had only 4, so I couldn't test it out completely. Also, you said you had 50 properties, but there was a smaller number in the example. Please attach another example which shows all the periods and the properties, and I'll work on the solution further (might be delayed a bit over Christmas).

    Pete

  10. #10
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Hi Pete... thanks for the help...

    I'm also currently on holidays so when i return after new year, i'll post the full list.

    Wishing a great Christmas and a Happy New Year to everyone here.

  11. #11
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Here's the full list

    Thanks for your help
    Attached Files Attached Files

  12. #12
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    Hi,

    I was away yesterday and have just got back - I'll take a look at this later on.

    Pete

  13. #13
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Hi Pete... Any news or clue on where i could start solving this headhacke?

    Thanks

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    See attached file. I've set up a simple booking sheet, although you might need to record other things like the name and contact details. Choose the property using the drop-down in column A, and enter the start date and end date in columns B and C. Formulae will then split the nights booked into the appropriate period in the next 8 columns. A further 8 columns return the nightly-charge for each period, and then these are multiplied together in column W to give a total for the booking. The formulae are copied down to row 50 - just copy them further if required.

    Hope this helps.

    Pete
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Hi Pete... Seems absolutely PERFECT!!!... Running some tests but so far, everything seems ok

    Thanks you so much...

  16. #16
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    Glad to be able to help.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, I would like to inform you that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  17. #17
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Thanks again for the help Pete... It is close to perfect...
    Just getting some errors now when properties do not have defined values on some of the time brackets (means they are not available for rent on those brackets but that's not realy bothering me to be honest...

    Also thanks for letting me know how to "Thank You" properly in terms of these Forums.

  18. #18
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    Pete... just a quick one after some tests:

    If i need to add a property to the list, let's say DD309C... what steps do i need to respect? i tried just adding a line in the correxpondent row, but it doesn't seem to be working properly.

  19. #19
    Registered User
    Join Date
    12-19-2013
    Location
    Faro, Algarve, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Get a value based on 3 conditions

    NVM Pete... got it... i missed the list at the end of the price chart on the first page

  20. #20
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Get a value based on 3 conditions

    Yes, I didn't know if you had any duplicates in your table, so I set up a separate list and used that as the source for the DV drop-downs. I didn't make it a dynamic list, though, as I didn't think you will be adding extra properties to the list.

    Pete

+ 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. How to sum based on two conditions
    By figsology in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-21-2013, 09:55 AM
  2. Need to sum based on two conditions
    By minal in forum Excel General
    Replies: 13
    Last Post: 05-09-2012, 02:37 PM
  3. calculation using reference to cells based on conditions
    By shrimic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2012, 12:32 PM
  4. Counting based upon 2 conditions that are text based
    By walkerdayle in forum Excel General
    Replies: 7
    Last Post: 08-21-2006, 08:35 PM
  5. Sum based on conditions
    By Hakojin in forum Excel General
    Replies: 4
    Last Post: 05-23-2006, 01:10 AM

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