mardi 28 juin 2016

How Do I Nest IF Functions in Order to Calculate Daily Revenue?

I am working on a data set and I need to calculate the daily revenue of fake AirBnb listings using nested IF statements. This is for a bootcamp I am attending, and I am stuck.

My instructions are as follows:

Estimate revenue per listing

  • Assume each booking always has 2 guests, unless the listing accommodates only one;
  • The booking is always for the minimum number of days allowed;
  • Only half of the bookings generate a review;
  • The extra person charge is per night (column name ‘extra_people’)

○ Format: have a column that calculates daily revenue (account for number of guests accommodated, number of guests included in the price, extra charge for additional people - using nested IF statements); another column would then calculates revenue per booking; finally, multiply that by the number of total stays the listings has had.

Using the data in my dataset, I am attempting to fill out column AA. So far this is what I have for my formula,

Formula

However, I get an error. I know the first part of this formula would work for the scenario in row 4. However, I need to make sure that the formula takes into account scenarios where the "guests included" is less than the "accommodates", because I must assume that each booking always has two guests except for when the listing only accommodates one person.

How should this formula be written? Can I not create equations within nested if formulas if it includes adding, subtracting, dividing, or multiplying columns together?

Dataset

Aucun commentaire:

Enregistrer un commentaire