I already have a spreadsheet set up for 23 salespeople. Row 24 is their customer service index averages. So across the top in B through X I have the salespeople. Their total scores in Row 22 and their averages in Row 24. I would like to rank their average (descending order) in Row 24. Excluding zeros.
Here is what I have come up with (in B28):
=IF(B24=0,"",IF(B24="x",COUNTIFS(B$24:X$24,">"&X24,X$24:X$24,"<>0",B$24:X$24,"x")+1,""))
it won't work.
Any help would be greatly appreciated. I am a quadriplegic running my own business, and any help I can get to not have to add/multiply/subtract/ divide would be a great thing!
Please try this instead:
=IF(B24=0,"",RANK(B24,$B$24:$X$24))
and copy across to suit.
If you're Excel 2010 or newer you can use the RANK.EQ() function. See http://office.microsoft.com/en-us/excel-help/rank-eq-function-HP010335687.aspx?CTT=5&origin=HP010335659 for usage.
Assuming you want to rank then in a descending order (higher numbers rank first), you can use the following:
In B28:
=IF(B24=0,"",RANK.EQ(B24,$B$24:$X$24))
Then just copy across to X28.
UseRANK() if you're using Excel 2007 or older.
Referring to the use of RANK() in Excel 2010 or newer, the Microsoft documentation states the following:
IMPORTANT This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. Although this function is still available for backward compatibility, you should consider using the new functions from now on, because this function may not be available in future versions of Excel.
I added more of the salespeople scores and had no more DIV/0 errors online 24 and low and behold, row 26 all filled in correctly. It was trying to calculate the 0 cells on line 24, in which there was 3 DIV/0, and they came up with a DIV/0 error all the way across row 26. Now if I can just figure out how to get it to put a 0 in their.
Related
Please have a look at the picture I attached, it'll make understanding my problem easier because it's hard to describe.
In the first table, I have capacity data for a product. The capacity changes by the date indicated in the column, i.e. from July 2017 the capacity would be 56, from December 2018 78, and from October 2019 99. The reason why I don't write down the capacity for every month is that I want to save columns.
In the second table, I have every month. I want to reference the correct capacity for each month, e.g. it would be 56 for every month until December 2018.
I have been considering an =INDEX function, but it seems to complex for that. Is there a way to reference like this without using VBA? Would the VBA solution be simple? Or am I forced to write a column for every month's capacity in the first table? Thank you!
https://i.imgur.com/mRoBtTo.png
You can simply use several IF statements to compare the month in your column with the months given in your first table, and put the value of the correponding month.
Let's admit your first row is 1 and first column is A, it should give something like:
= IF(D7>=$F$2; $F$3; IF(D7 >= $E$2; $E$3; IF(D7 >= $D$2; $D$3; "")))
I dont see you columns and rows so i hope you will change them correctly on this formula:
=HLOOKUP(C111,$C$106:$P$107,2,TRUE)
C111 is the cell above your red row.
$C$106:$P$107 is the tableof capacities, i know it is bigger then the current one so you see you can add more columns.
2 is the row number from the capacity table.
true is becouse you dont want it to be the exact value it will take the previews in hte order of items
Both previous answers work perfectly, but I would go this way-
You don't actually need an if to find the previous capacity. you can simply use the approximate match (similar to the hlookup answer) in an index formula
=+INDEX($B$4:$E$5,MATCH($B$9,$B$4:$B$5,0),MATCH(C9,$B$4:$E$4,1))
The product $B$9 matches exact (0), but the date C9 is bigger than or equal (1).
$B$4:$E$5 is the source of capacity and
C9:AF9 the date timeline
Final advantage would be that you can have several products to index, not only a single one.
Could you please try the below formula and provide feedback please?
=IF(AND(D8>=D2,D8<E2),"56",IF(AND(D8>=E2,D8<F2),"78",IF(D8>=F2,"99")))
I've searched here and elsewhere for a solution to my problem. I've tried using different versions, including testing subsets, of the formula below, but have had no luck. I hope you can help me. This is for my personal use at home, as I'm now retired.
I'm using Excel 2007 on Win10. In a specified date range (subset of larger spreadsheet covering more dates before and after), I want to find the date the lowest electricity (kwh) usage occurred, but higher than a minimum of 9), but also only that measured for a 24 hour period. In this formula:
{=INDEX(A3934:A4966,MATCH(MIN(IF(C3934:C4966>9,IF(E3934:E4966=24,C3934:C4966))),C3934:C4966,0))}
Column A is Date, C is usage, E is time (expressed as a number, e.g., 22.75, 24.00, etc.)
Note: I'm not using named ranges
Excel finds a date of correct minimum usage, but the date has a time of less than 24 hours! (there are several dates with the same minimum usage, but only a couple for a 24 hour time period. It seems to work on a 20-day range of data, but if I expand it to the above range, it doesn't. Can you please tell me what is wrong with my formula (or approach)? I've tried reversing the usage and time criteria, but it made no difference (I didn't expect it to). Thanks very much.
I think it is solved....
{=INDEX(A3934:A4966,MATCH(MIN(VALUE(REPLACE(C3934:C4966,1,20,MIN(IF(E3934:E4966=24,1,99)*IF(C3934:C4966>9,C3934:C4966,99))))),C3934:C4966,0))}
I used 99 to have a higher number and exclude it from MIN function.
Say I have the dataset below, what is the most efficient formula to fill the cells in column D, where the number of patients alive are calculated?
Example data set in excel
The way it should calculate is:
month 1: 8*100% = 8
Month 2: 8*80%+6*100% = 12.4
Month 3: 8*75%+6*80%+9*100% = 19.8
...
Month 10: etc.
The problem that I have is that which each row, the formula becomes longer. It is feasible to just manually enter the formulas for small datasets, but as datasets become larger, this task becomes unfeasible.
I have been able to use VBA to code the survival of the number of new patients column (C). But then I would have to rerun the VBA code as soon as I change a single value in that column.
I have a feeling it should be possible with some combination of the INDEX function in excel, I just haven't been able to figure it out.
Who can help me out here?
Kind regards,
Sander
If moving the data a bit is allowed at least for the calculation, you could do something like this:
=SUMPRODUCT($F$11:$F$20,B2:B11)
It uses a reversed list of your current list of new patients. That list is created with (formula obtained from this site):
=INDEX($C$11:$C$20,COUNTA($C$11:$C$20)+ROW($C$11:$C$20)-ROW())
Result:
The added space is necessary for the formula to work (so that it gets 0% for patients not present yet).
Or one where you don't have to leave spaces (everything from above is reversed however):
=SUMPRODUCT($C$2:$C$11,G11:G20)
I am working on a financial model in excel. If the number of customers is between 1-10000, the cost is .20 per customer per month, 10000-100000 is .15 per customer per month, 100k and 1MIL is .10 per customer per month and > 1MIL is .08 per month per customer.
What I would like to do is create a formula where if the cell that references the number of customers at that month is within those values above, the cost per month changes depending on the number of cstomers.
This is what I have:
=IF(AND(B6>=1,B6<=10000),$Q$6), IF(AND(B6>10000,B6<=100000),$Q$7), IF(AND(B6>100000,B6<=1000000),$Q$8),IF(AND(B6>1000000),$Q$9)
Q6, Q7, Q8, Q9 are respectively: $.20, $.15, $.10, $.08
My B6 cell is the cell that is pulling over the number of customers from another sheet.
I am getting a #VALUE! Error when I use this formula. It works if I simply have:
=IF(AND(B6>=1,B6<=10000),$Q$6) which leads me to believe that my logic is wrong with all of the IF statements, and I should be using ELSEIF but I am not sure the syntax for that.
Help is appreciated!
So this is how I fixed this issue in case anyone had the same issue:
=IF(B6<=10000,$Q$6,IF(B6<=100000,$Q$7,IF(B6<1000000,$Q$7)))
By nesting the if statements with higher values excel automatically recognizes the max value for that if statement!
It seems that you are closing the IF statements too soon. Your formula repaired would look like,
=IF(AND(B6>=1,B6<=10000),$Q$6, IF(AND(B6>10000,B6<=100000), $Q$7, IF(AND(B6>100000,B6<=1000000), $Q$8, IF(AND(B6>1000000),$Q$9))))
If you start at the upper limit, you can reduce the conditions with sequential logic.
=IF(B6>1000000,$Q$9, IF(B6>100000, $Q$8, IF(B6>10000, $Q$7, IF(B6>=1,$Q$6, 0))))
You could probably do that a little more easily like this
=IF(B6>1000000,$Q$9,IF(B6>100000,$Q$8,IF(B6>10000,$Q$7,IF(B6>=1,$Q$6,"Error))))
You don't need AND because the IF functions are implicitly checking a range because the previous IFs rule out ranges of values
I keep a running avg of kids grades in Excel over a 2 week period. The way i have the code now
AVERAGE(OFFSET('1'!E4,COUNTA('1'!D:D)-29,):OFFSET('1'!E4,COUNTA('1'!D:D),))
it returns an error if i don't have 2 weeks of data. I found a way around this by doing this
=IFERROR(AVERAGE(OFFSET('1'!E4,COUNTA('1'!D:D)-29,):OFFSET('1'!E4,COUNTA('1'!D:D),)),IFERROR(AVERAGE(OFFSET('1'!E4,COUNTA('1'!D:D)-28,):OFFSET('1'!E4,COUNTA('1'!D:D),)),IFERROR(AVERAGE(OFFSET('1'!E4,COUNTA('1'!D:D)-27,....
Im Sure there is a better way to do this any help would be appreciated.
As pointed out in the comments - it's difficult to give a definitive answer without some more knowledge - it's not easy to tell, for instance, where the numeric data starts (E4 or E5)?
Firstly you can simplify your original formula which appears to AVERAGE the last 30 rows of data (not sure how 30 rows equates to 2 weeks of data) - you can do that with just:
=AVERAGE(OFFSET('1'!E4,COUNTA('1'!D:D)-29,0,30))
Now I assume the error comes about when COUNTA('1'!D:D) is < 29 so you can simply add an If function which AVERAGES all the data if that function returns a number < 29, i.e.
=IF(COUNTA('1'!D:D)<29,AVERAGE('1'!E4:E33),AVERAGE(OFFSET('1'!E4,COUNTA('1'!D:D)-29,0,30)))
That formula may need some small adjustments to cater for the specifics of your layout but the general approach is valid