Rank if on various Criterias Problem

manloonw

New Member
Joined
Mar 18, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Been having a nightmare trying to figure out formula for the below, if any Einstein around can help would mean alot.

I have gathered certain data regarding Cinema Sales and I'm trying to calculate based whether each show shall be based on the higher rate (Regular) or lower rate (Special) as in Column O.

% Rates differ on variables: The Week, Major (Big Cinema)/Minor (Small Cinema). Also there's conditions on if the show's are regular or special showing:

- Shows during peak times 14,17,19,21 will be automatically classed as Regular
- Week 1 must have at least 4 showings per day or else all will be classed as regular

- Less than 4 Regular Shows per day, will change the highest Gross Revenue Special Show and charge it as Regular. Until there's 4 regular shows.

*The breakdown of the rates can be found on "CORE Tab in Column L:N"

I have got the formulas down, but I can figure out how I should do the last condition. I have tried using the Countif function as Rankif in column N and linking this to my If formula in Column O as <=4 Rank but the error occurs when I have to limit the shows to 4 Regular. Example in row 4:8 it has classed all as regular.

Please help.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Example Cinema.xlsx
ABCDEFGHIJKLMNOPQ
2CircuitCinemaReleaseTypeDateTimeHouse/ HallAdmissionGross RevenueTime zoneRelease2WeekShows Per DayRankR/SRateFilm Rental
4John Doe Cinema Management LtdEBTAJ2D11-Mar11:15House 1957911Major152R50%289.5
5John Doe Cinema Management LtdEBTAJ2D11-Mar13:10House 20013Major154R50%0
6John Doe Cinema Management LtdEBTAJ2D11-Mar15:20House 115168515Major151R50%842.5
7John Doe Cinema Management LtdEBTAJ2D11-Mar19:35House 15019Major155R50%0
8John Doe Cinema Management LtdEBTAJ2D11-Mar21:40House 1226021Major153R50%130
DATA
Cell Formulas
RangeFormula
L4:L8L4=IF(B4="","",VLOOKUP(E4,'C:\Users\206676612\OneDrive - NBCUniversal\My Documents\Desktop\[EMP - TAJ. EOM TEST.xlsm]CORE'!F:G,2,FALSE))
M4:M8M4=IF(B4="","",COUNTIFS(C:C,C4,B:B,B4,E:E,E4))
N4:N8N4=IF(B4="","",(COUNTIFS(B:B,B4,E:E,E4,I:I,">"&I4)+1+COUNTIFS($B$2:B4,B4,$E$2:E4,E4,$I$2:I4,I4)-1))
O4:O8O4=IF(L4<=$L$1,IF(OR(J4=14,J4=17,J4=19,J4=21),"R",IF(M4<=4,"R",IF(N42<=4,"R","S"))),IF(OR(J4=14,J4=17,J4=19,J4=21),"R","S"))
P4:P8P4=IF(L4="SNEAK",IFERROR(INDEX(CORE!$M$2:$N$16,MATCH(("SNEAK"),CORE!$L$2:$L$16,0),MATCH(K4,CORE!$M$1:$N$1,0)),""),IFERROR(INDEX(CORE!$M$2:$N$16,MATCH((L4&O4),CORE!$L$2:$L$16,0),MATCH(K4,CORE!$M$1:$N$1,0)),""))
Q4:Q8Q4=IF(B4="","",I4*P4)
J4:J8J4=IF(B4="","",HOUR(F4))
Named Ranges
NameRefers ToCells
Cinema=Table2[Cinema]M4:N8
date=DATA!$E$3:$E$57M4:N8
GR=Table2[Gross Revenue]N4:N8
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top