I am searching for an answer to the question below.
I am creating individual-level life tables in excel and only need the formula to run until a max possible age of 100.
I am using the excel formula below. This, ($G7+I$6) represents age + time period. Stating the obvious, this is not the output value but rather a component of the formula.
=EXP((-$C$2^-1)*(EXP($C$3+($D7*$F$2)+($C7*$F$3)+($B7*$F$4)))*(EXP($C$2*($G7+I$6))-1))
Once again, I need the formula to run until ($G7+I$6) reaches 100. So the formula should stop once ($G7+I$6) reaches 100.
How do I do this?
Any advice would be appreciated.
Thanks in advance,
Jay
Why not wrap the entire formula in an IF Statement where =IF(($G7+I$6)>=100,Error Condition or let you know,EXP((-$C$2^-1)(EXP($C$3+($D7$F$2)+($C7*$F$3)+($B7*$F$4)))(EXP($C$2($G7+I$6))-1))
As above, the solution is this:
Excel formula: =IF(($G7+I$6)<=100,((EXP((-$C$2^-1)*(EXP($C$3+($D7*$F$2)+($C7*$F$3)+($B7*$F$4)))*(EXP($C$2*($G7+I$6))-1)))))
Related
I'm trying to rank the following items based on price using the following formula =SUMPRODUCT(([Item]=[#Item])*([#Price]<[Price]))+1, but it isn't returning any results:
When I use the same formula in the following test table it works, =SUMPRODUCT(($A$2:$A$7=A2)*(B2<$B$2:$B$7))+1:
Can someone please let me know what I am doing wrong? Thanks
EDIT 2 : Evaluation https://imgur.com/a/eXIYPAP
Your formula works fine for me.
Are you sure that A2 and A3 are the same value? There may be some hidden white space causing problems. Just try
=A2=A3
in another cell to make sure they are the same.
USE COUNTIFS INSTEAD
I don't know why your formula isn't working, however, I would suggest avoiding SUMPRODUCT where you can.
=COUNTIFS([Item],[#Item],[Price],">"&[#Price])+1
This will count the number of prices higher than the current one for each item (+1, if you want the rank to start at 1 instead of 0)
If your goal is to get the ranking for each unique item, =SUMPRODUCT(([Item]=[#Item])*([Price]>[#Price]))+1 should do the trick. If the goal is to get the ranking based only on price, don't have it figured out yet.
DESPERATE for any help :-)
I need to exclude 0 values from my =COUNT excel formula in order to get an automated frequency value feeding another formula in my model.
Actual Base Formula:
=COUNT(J10,J11,J12,N10,N11,N12,J14,J15,J16,N14,N15,N16)
I am trying to get the formula to NOT count when any of these cells have O values. For instance, if J10 is greater than 0, include it in the count.
I have tried several different "IF" statements, but am failing miserably!
I basically need to dummy proof this by automating it versus having users simply count the cells with values and enter the number into the frequency field for my score calculator. Thanks so much for any help!!
Since your range is disjointed the best method is four(4) countifs:
=COUNTIF(J10:J12,">0")+COUNTIF(N10:N12,">0")+COUNTIF(J14:J16,">0")+COUNTIF(N14:N16,">0")
Fixed based on the comments.
=COUNTIF(J10:J12,">0")+COUNTIF(N10:N12,">0")+COUNTIF(J14:J16,">0")+COUNTIF(N14:N16,">0")
I'm using counting invoice numbers (text) in a table's column, but the Excel formula seems to be confusing some values.
I copied small sample of these - please refer to below:
The formulas are as follow:
=COUNTIFS(A1:A19,A1)
=COUNTIF(A1:A19,A1)
As you can see these invoice numbers differ and the results of these functions suggest as if all were the same.
I googled it for 1 hour but I didn't find such as issue as mine.
If anybody had any clue why could this behave in such way I'll be super grateful!
Rob
Each time you copy down this formula it will add 1 row to each. For example the second row of datas formula will be =COUNTIFS(A2:A20,A2). To lock these cells in the formula use $
Your formula should be =COUNTIFS(A$1:A$19,A1)
I've solved this myself:
ROOTCAUSE
Excel tried to be helpful and read these invoice numbers as actual numbers (despite these being defined already in Power Query as text)
Then, Excel fooled me and despite showing that it works on it as a string (I was evaluating the formula) it worked on it as number
Above means that it transformed exemplary "00100001010000018525" to 1.00001E+17, which cut down this to "100001010000018000" - that's the moment Excel stopped fooling around and showed that value in the formula bar.
I think I don't need to tell why countif perceived all these values as equal.
SOLUTION
I simply appended one letter after each invoice number to get e.g. "00100001010000018525a" what forces Excel to quit its gimmicks and games.
Case closed.
I suspect this is a bug in COUNTIF, or maybe by design.
However, to workaround this in the formula, without having to change your data, try adding a wild-card character:
=COUNTIF(A1:A19,"*"&A1)
Background:
This excel is to track the hours someone works and what days. It also needs to track the total days worked in a week.
Requirement:
The 'Total Days' column needs to count the Monday(M) to Sunday (S) columns if they are greater than 0
Previously I had a simple COUNTIF(H6:K6, ">0") or whatever it was, which worked well.
Now the user has added in extra columns for pay and charge rates each day, after the corresponding day, which has thrown the formula off, and the COUNTIF formula wont do the columns separately inside the same formula.
Snippet of excel layout
Also some clarification, In AZ1 for instance I would want it to count H1, K1, N1, etc up to Z1
If anyone could help me work out a formula, that would be great!
COUNTIFS uses AND logic, whereas, you need OR logic. Try something like:
=COUNTIF(A3,">0") + COUNTIF(B3,">0")+...
EDIT: Since that didn't work, this should do the trick:
=COUNTIF(H5,">0")+COUNTIF(K5,">0")+COUNTIF(N5,">0")+COUNTIF(Q5,">0")+COUNTIF(T5,">0")+COUNTIF(W5,">0")+COUNTIF(Z5,">0")
Try using the MOD function to determine the stagger of the columns. SUMPRODUCT and ISNUMBER can take care of the rest.
=SUMPRODUCT(NOT(MOD(COLUMN(H:Z)-8, 3))*ISNUMBER(H6:Z6))
I would need some help again with another excel countif expression. I have the line i2:al2 which contains leftover stock data.I am building a worksheet to calculate remaining stocks in % as per supervisor's wish.
As I am working with %, for example if I say that 90% sales that means we have 103 stock left and with 91% sales I have 100 stock left.
Anyways I got around to count the number of stock left in line i2:a12 using countifs.
Example if I need to calculate leftover stock for sales at 90% which means leftover stock level of 100 to 102. I have used :
=countif(range,">100")-countif(range,">102")
This method seems to work till I reach negative numbers, i.e. oversales. For example, if I try to do the following:
=countif(range,"-100")-countif(range,">0")
the formula seems to stop working. If I count manually using a conditional formatting I get a totally different answer for the oversales.
Maybe I am getting the logic of the countif function wrong. My purpose for the expressison is:
=count(in range, values >=X & <=Y)
As I have only access to excel 2003 I cannot use Countifs method. Anyone could help me on this issue?
Many thanks.
You can use an array formula:
=SUM((range>=x)*(range<=y))
For that to work, you need to press CTRL-SHIFT-ENTER for that to use array formula.
Alternatively, using what simoco gives in the comment works too without having to save as array formula.