+ Reply to Thread
Results 1 to 7 of 7

Calc total cost based on room rates

  1. #1
    Registered User
    Join Date
    05-10-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Calc total cost based on room rates

    Hi all,

    I have just started working at a backpacker hostel and need some help updating an excel sheet that they use. I need quite a complicated IF formula, I believe.

    It is for their payment spreadsheet and the necessary columns are as below;

    E F G H
    Room No. Nights No. Persons Total


    There are different prices for the different rooms as follows
    Room Numbers 2, 3, 4, 6, 8 and 10 are $39
    room 1 is $16
    room 5 is $15
    room 7 is $12

    what we need in column H is a formula that will take the room number, figure out which price it is, multiply it by number of nights, also multiplied by number of people, and finally multiply the total price by 45 to display it in local currency...

    the other factor is that rooms 2,3,4,6,8 and 10 are $39 regardless of how many people are in it, whereas rooms 1, 5 and 7 are priced per person, so THOSE rooms need to multiply by number of persons in column G.

    So as an example;


    E F G H
    Room No. Nights No. Persons Total
    1 2 1 $1,440
    5 14 1 $9,450
    2 7 2 $12,285
    7 6 2 $6480


    I know it is a really complicated one, but if it is possible to create a formula for it that would help out a lot otherwise we have to keep manually calculating the price each time.

    I hope someone can help!

    Thank you!
    Last edited by FDibbins; 02-05-2015 at 11:40 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-04-2011
    Location
    UK
    MS-Off Ver
    Excel 2021
    Posts
    346

    Re: Complex IF formula help

    for the room price in H;

    =IF(E1=1,16,IF(E1=5,15,IF(E1=7,12,IF(OR(E1=2,E1=3,E1=4,E1=6,E1=8,E1=10),39,"N/A"))))

    and the total would be x No nights x No person x 45

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Calc total cost based on room rates

    Rachelle, welcome to the forum

    For future reference, please title y6our threads with something that describes your problem, not what you thing the solution might be. (I have changed it for you - this time)

    You probably need to use VLOOKUP(), but can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,641

    Re: Calc total cost based on room rates

    Try this:

    Please Login or Register  to view this content.
    where E2=1, pick 16*G2 (price*persons), E2=2, pick 39,...,E2=5, pick 15*G2,...then multifly with night no and 45
    Quang PT

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,227

    Re: Calc total cost based on room rates

    Hi Rachelle and welcome to the forum,

    I have two answers for you. One is using the Choose() function like bebo above and the other is closer to Alan's. Examine both in the attached table and see if you want to use Choose() or VLookup()
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    05-10-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Calc total cost based on room rates

    Hi Ford,
    oops, sorry about that! thanks for renaming the thread for me!

    here is a small example, it is in Spanish sorry about that but I think it is still clear.

    test.xlsx

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,047

    Re: Calc total cost based on room rates

    Try this, copied down (Im sure someone will simplify it for you)...
    =(B2-A2)*45*IF(VLOOKUP(E2,$C$10:$D$19,2,0)=39,39,VLOOKUP(E2,$C$10:$D$19,2,0)*G2)

+ 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. [SOLVED] Use an existing cell formula for creating a new more complex formula
    By dubcap01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 07:41 AM
  2. Assistance with reporting data inorder with no blank cells or rows inbetween
    By Ghost Of Casper in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-28-2013, 01:37 PM
  3. Complex IF formula
    By elanum in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-12-2013, 08:12 PM
  4. Replies: 2
    Last Post: 04-04-2012, 01:50 PM
  5. [SOLVED] Complex formula?
    By Jean in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2005, 08:05 PM

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