I have a simple table consisting of two columns:
CLIENT REVENUE
___________________________
A 5000 USD
B 7500 USD
C 6000 USD
D 2500 USD
... ...
I want to create a dynamic top 10 client list, that automatically updates itself as revenues are changed.
I have already been able to list the top 10 revenues by using the LARGE function, but I have trouble with getting the clients' names next to the revenue numbers.
A simple way to do this would be to combine the Index and Match functions like this :
=INDEX(A:A,MATCH(E1,B:B,0))
This assumes your client names are in column A, Revenue is in column B, and the the large() revenue you are looking up is in cell E1
Additionally this simple approach will return the first client name with the 'large' revenue and in the rare event that two clients had the exact same revenue the above formula will show the first client twice.
An approach that handles the offset from duplicate revenue's would look like this:
=IF(ISNUMBER(E1),INDEX($A$1:$A$13,SMALL(IF($B$1:$B$13=E1,ROW($A$1:$A$13)-ROW($A$1)+1),COUNTIF(E$1:E1,E1))),"")
Note Array formula ctrl+shift+enter after typing, then drag down to the right of your Large() revenue numbers.
Here's a screenshot of the second formula deployed in the event that you need to use it:
(while the first approach is simple, cell F3 is an example of where the additional complexity may be required)
Related
I'm wondering if there is an easy way to do what I'm looking for. Basically, I have a balance sheet in Excel 2011 with a bunch of data. One specific piece of information I always want visible is the amount that hasn't been reimbursed. In other words, I have a column for the amount paid and another for whether or not it has been reimbursed (Yes/No). I want to sum all of the amounts paid where the reimbursed field is equal to 'No'.
I recognize I can sum the entire column and filter out those that have been reimbursed, but I'd like it to display the full amount regardless of what filter is on (or if no filter is on).
I wasn't able to find good keywords to describe this to Google, so I'm asking here. I would like to accomplish this in Excel, not in an external program or script.
If column A contains the amounts to be reimbursed, and column B contains the "yes/no" indicating whether the reimbursement has been made, then either of the following will work, though the first option is recommended:
=SUMIF(B:B,"No",A:A)
or
=SUMIFS(A:A,B:B,"No")
Here is an example that will display the amounts paid and outstanding for a small set of sample data.
A B C D
Amount Reimbursed? Total Paid: =SUMIF(B:B,"Yes",A:A)
$100 Yes Total Outstanding: =SUMIF(B:B,"No",A:A)
$200 No
$300 No
$400 Yes
$500 No
You could do this using SUMIF. This allows you to SUM a value in a cell IF a value in another cell meets the specified criteria. Here's an example:
- A B
1 100 YES
2 100 YES
3 100 NO
Using the formula: =SUMIF(B1:B3, "YES", A1:A3), you will get the result of 200.
Here's a screenshot of a working example I just did in Excel:
You should be able to use the IF function for that. the syntax is =IF(condition, value_if_true, value_if_false). To add an extra column with only the non-reimbursed amounts, you would use something like:
=IF(B1="No", A1, 0)
and sum that. There's probably a way to include it in a single cell below the column as well, but off the top of my head I can't think of anything simple.
I have a little problem with a dataset.
My data look like this:
Volume Pressure
Patient 1 31 15
34 35
32 44
Patient 2 34 23
23 23
23 24
I want to obtain a final output of a mean patient that has for each value of pressure and of volume the mean of the pressures/volumes of the two patients.
Volume Pressure
Mean Patient (31+34)/2 (15+23)/2
(34+23)/2 (35+23)/2
(32+23)/2 (44+24)/2
I have no idea how to write this rule, as I don't know how to explicit that I want to repeat this procedure for every patient I have (I have more than two).
Thank you very much in advance!
I think you are making it too difficult. Simply use AVERAGE and drag.
For example, =AVERAGE(B7,B2)
IF you are open to a helper column you can use the following solution.
For the helper column you want to ad a test/sample ID. To keep it simple I used a numbering system starting at 1 and increments by 1 for each successive test. Plae the following formula in a column adjacent to your first patient results and copy down. You can hide this column later for presentation purposes or stick it off to the side if so desired
=IF(AND(A3="",B3=""),"",IF(AND(A3<>"",B3<>""),1,E2+1))
Then lets build a table of results. Column 1 will be your test/sample ID. Column 2 will be your mean volume, and column 3 will be your mean pressure. In the first cell of column 2 place the following formula:
=SUMIF($E:$E,$G3,B:B)/COUNTIF($E:$E,$G3)
Copy this formula down as needed and one column to the right.
Update cell references to suit your needs.
Dont use full column reference if you have other information in the column either above or below your data range.
I need excel to sum user amount and price based on amount of users. However the pricing is staggered and the price per user is cheaper the more users you have
Users Price per user
1-10 600
11-20 500
21-30 400
31-40 300
41-50 200
50+ 100
Is it possible to have a formula which returns a value based on the number of users but uses the price depending on which pricing bracket the amount of users falls into
Is there a finite amount of users or could it be unlimited?
There are a couple of formula methods you could use but could become cumbersome if we are talking 20+ potential brackets.
Compound IF statement:
Lets say A1 is where the number of users is entered
Col B is where your lower brackets are held
Col C is where your higher brackets are held
Col D = price
=IF(AND($A$1>$B1,$A$1<=$C1),($A$1*$D1),IF(AND($A$1>$B2,$A$1<=$C2,($A$1*$D2).....,"") etc
Create your brackets on a separate sheet and use a VLOOKUP to identify which bracket the user number lies within and multiple by the resulting bracket price.
I have a list of clients on sheet1 in a spreadsheet like so:
Date Entity Sector Client Spend
April 2016 Group1 Aerospace Client A £2,000,000.00
April 2016 Group1 Aerospace Client B £5,000,000.00
April 2016 Group2 Rail Client C £13,000.00
April 2016 Group1 Aerospace Client D £45,000.00
April 2016 Group1 Telecoms Client E £20,000.00
I want to pull through a list of the top 10 clients we spend with.
I have certain parameters / criteria i need to set, i.e.
The Client must have a 'Group1' entity and must come under the 'aerospace' sector.
In Cell A10 i place my sector = Aerosapce
In cell C6 i allocate my group = Group1
So far i am using this array formula and dragging it down 10 rows, to produce 10 unique results.
=IFERROR(INDEX('Opp Data'!$H2:$H5000,MATCH(1,('Opp Data'!$G$2:$G$5000&'Opp Data'!$F$2:$F$5000=$A$10&$C$6)*('Opp Data'!$K$2:$K$5000=LARGE(IF('Opp Data'!$G$2:$G$5000&'Opp Data'!$F$2:$F$5000=$A$10&$C$6,'Opp Data'!$K$2:$K$5000),ROW(1:1))*(COUNTIF($C$13:$C13,'Opp Data'!$H$2:$H$5000)=0)),0)),"")
This should give me the clients in order with the biggest to lowest spend, producing a result like so:
Client Sector Spend
Client B
Client A
Client D
etc
etc.
Next to the client name i want to list the relevant sector that client belongs to, i.e. "Aerospace" and the spend in the column next to that.
I am doing this by using index match:
=IFERROR(INDEX('Opp Data'!$C:$C, MATCH(A2,'Opp Data'!$D:$D, 0)),"")
At the moment the data is all over the place and spends are not corresponding with the client name, and some clients are being shown that are not in group 1 or aerospace.
I am getting this:
Client Sector Spend
Client B Rail £20,000.00
Client A Aerospace £13,000.00
Client D Telecoms £2,000,000.00
etc
etc.
But i should be getting this:
Client Sector Spend
Client B Aerospace £5,000,000.00
Client A Aerospace £2,000,000.00
Client D Aerospace £45,000.00
etc
etc.
Please can someone show me where i am going wrong and let me know if there is a better way to do this?
Thanks in advance
To get your table the best way would be a Pivot Table with filters. This will allow you to do what you want.
Outside of that IF you want the formulas then:
First get the top Spend. To do this we need to use the LARGE() or AGGREGATE() function:
=IFERROR(AGGREGATE(14,6,$E$2:$E$6/(($C$2:$C$6=$G$2)*($B$2:$B$6=$H$2)),ROW(1:1)),"")
Put this in the first cell of your Spend column and drag down. The Row(1:1) acts as a counter that increases as it gets dragged down. That way it find the first largest then the second and so forth.
The part below / dictates that only those that meet the criteria get used. I put Aerospace in G2 and Group1 in H2.
Then we can use another AGGREGATE() function in side an INDEX to get the other data on the other two columns:
Sector:
=IF(L2<>"",INDEX($C$2:$C$6,AGGREGATE(15,6,(ROW($C$2:$C$6)-1)/(($E$2:$E$6=L2)*($B$2:$B$6=$H$2)),COUNTIF($L$2:$L2,L2))),"")
Or, since we have the desired Sector already in a cell we could simply:
=IF(L2<>"",$G$2,"")
Client:
=IF(L2<>"",INDEX($D$2:$D$6,AGGREGATE(15,6,(ROW($D$2:$D$6)-1)/(($E$2:$E$6=L2)*($B$2:$B$6=$H$2)),COUNTIF($L$2:$L2,L2))),"")
We use the AGGREGATE again instead of MATCH in case there are ties with the amount in Spend. The COUNTIF() allows us to get those duplicates where Match would only return the first one for both.
When editing the ranges on the formulas to match yours pay attention to this part: (ROW($D$2:$D$6)-1) This again is a counter that returns an integer back to the INDEX() function. We need it to start at 1. So if your data starts in Row three we would need to change the 1 to 2. It should be 1 less than the starting row.
Along with Pivot Tables, look into Advanced Filter and VBA. See HERE to see how they might help with your problem.
Last time, I asked a question about how to do a sumproductIF for one condition and it works great. However, if there are two (or more condition), I would like to know how to write a sumproduct with multiple conditions style to avoid adding extra column.
The purpose of the calculation is to find the final total cost of T1 in USD with single step
Currently, the total cost of T1 in USD can be found by find the PriceQTY with currency conversion (step 1 in the picture), then find total of T1 by SUMIF(TYPE,"T1",PriceQTY)
If you use SUMIF instead of LOOKUP then you don't need to sort the currency table, i.e.
=SUMPRODUCT((A10:A24="T1")+0,B10:B24,D10:D24,SUMIF(B$4:$B$6,C10:C24,$C$4:$C$6))
If the fx rate table can be ordered (in alphabetic order) and include USD = 1, you could use this array-formula (you need to validate it by pressing CTRL+SHIFT+ENTER):
=SUM((A10:A24="T1")*(B10:B24)*(D10:D24)*(LOOKUP(C10:C24,$B$4:$B$6,$C$4:$C$6)))
This assumes that:
the fx table is in B4:C6, with EURO, JPY and USD in that order
the main data table is in A9:E24 (titles on line 9)