# Formula Problem Countif based on Unique value and based on another comlum

Copper Contributor

# Formula Problem Countif based on Unique value and based on another comlum

I will first off say I am a travel agent to give you some context on what I use this information for. I have basic knowledge in Excel and it has all been self taught. For this spreadsheet my Microsoft Flow will input data into this spreadsheet and the counter at the top will keep track of how many seats/rooms I have sold vs unsold for group bookings.

*For the number of people I think I have it figured out. The only correction I would try and make is counting adult seats.  My way works but I dont think this is the best way. Ideally I would like to count adults it counting the number of people that do not have a value in the Child's Age Column. If that cant be fixed then that's fine.

What I am using right now is just Minus-ing the amount of teens/kids/infants. How I Calculate Adults.

ds/infants

Now Onto my bigger issue and the main reason why I am posting.

Counting the number rooms is more difficult. Each room is generated an ID through Microsoft Forms/Flow. This is their "room number".

1. For L5 I would like it to be total of Junior Suite Rooms. From what I am thinking it has to count the unique values (room number) from a14:114 and it has to match it with what rooms (k14:k114)  that are labeled as Junior suites.  I believe I have use a countif or sumif but all the different ways wont work for me. This would = the amount of Junior Suites I have sold

(Keep in mind I dont just want to count all the Junior Suites(K14:k114) since sometimes there is anywhere from 1-4 people in a room)

2. Now After that I want to calculate L6, L7, L8, L9,L10, etc.

What I want it to do is calculate the unique values from Room Number (a14:a114)+match the rooms labeled as Junior Suites (K14:k114)+ match it with the Departure city (H14:114)(Regina, Saskatoon, etc.)

This would then = the amount of Junior Suites I have sold from Regina (or Saskatoon, etc)

Total Number of rooms is a number I put in (no formulas). Then once I have the above two situations figured out "unsold" as a simple formula. For example "total"-"sold"= unsold.  This is something I know how to do.

Thank you in advance!! Between this and Microsoft Flow this is going to save me so much time and I am super excited!

Thank you,

Samantha

0 Replies