Solved

Excel Percentile Calc Across Multiple columns

Posted on 2011-02-24
6
1,026 Views
Last Modified: 2012-05-11
Hi Experts,
I have an Excel sheet where I want to look up a value and then calculate a percentile across multiple columns.  I get how to calculate a percentile across multiple columns and how to calculate a percentile based on meeting a certain criteria - but I have no idea how to combine the two.

This is difficult to explain typed out - see the attached.  I understand how to calculate G2 and G3, but G4 (which is kind of a combination of the two) is where I am stumped.  This is a simplified version, the real one has significantly more data.

Thanks in advance.
Sample.xlsm
0
Comment
Question by:Hardly_an_Expert
  • 3
  • 2
6 Comments
 
LVL 9

Expert Comment

by:McOz
Comment Utility
try:

{=PERCENTILE(IF(A2:A43="Retail",B2:D43),0.9)}

enter as an array formula. I have attached your sample file, with the fix.

good luck!
McOZ
Sample.xlsm
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
I think you need to filter out blanks, too, otherwise both your original formula and McOz's suggestion for all three columns will count blanks as zeroes and skew the calculation.

For your basic calculation you can use all three columns in one assuming they are contiguous, i.e.

=PERCENTILE(B2:D43,0.9)

That will automatically ignore blanks but for your next calculation in G3 where you use an IF the blanks are converted to zeroes in the process so for G3 you should use

=PERCENTILE(IF(A2:A43="Retail",IF(B2:B43<>"",B2:B43)),0.9)

and then G4 is the same except the last range(s) are extended to D, i.e.

=PERCENTILE(IF(A2:A43="Retail",IF(B2:D43<>"",B2:D43)),0.9)

regards, barry
0
 
LVL 50

Expert Comment

by:barry houdini
Comment Utility
see attached example

barry
26845770.xlsx
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Hardly_an_Expert
Comment Utility
HI Barry and McOz,
I just had a "duh" moment in looking at your responses... unfortunately, I over simplified my example - there is actually data between the various columns which prevents me from using one big array (e.g, B2:D45).  I am pretty sure I need to look at each column individually.  The problem I am running into is referencing 3 different columns which may have many columns of both text and numbers in between.

See the new attached sample which better reflects my situation.
Sample.xlsm
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
Comment Utility
OK, with that version the simplest way it to use the common values in the header row (row 1), i.e. in your example all the header row columns from which you want data start with "Plan" so you can use this formula in I4, again to exclude blanks

=PERCENTILE(IF(A2:A43="Retail",IF(LEFT(B1:F1,4)="Plan",IF(B2:F43<>"",B2:F43))),0.9)

confirmed with CTRL+SHIFT+ENTER

does your real data have those headers?

regards, barry
26845770v2.xlsx
0
 

Author Closing Comment

by:Hardly_an_Expert
Comment Utility
Interesting approach - I can make that work.
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now