How to workaround average function in excel? - excel

I've taken an online excel course and stuck at one of the exercise for average function.
In the image, the average function is showing error div/0
Note that TAX column values have been calculated by formula. Is that the reason for this error? I tried searching online but could not get any proper answers... can anyone please help? Thank you.
Formula applied in tax column =IF(AND(C2 < 100), "50","100")

Related

Index Match & SumIfs formula giving error

I am getting a #Ref error while using sumif and index match formula for below tables.
All I am trying to do here is to sum total hours for a particular employee who worked on multiple projects for a specific period.
For below example for Shafil Buksh, it should return 26 hours but instead I get an error.
Can you please suggest the correction to this formula or if I should use completely different formula to get the result?
Thank you in advance!

How to run a formula until max or threshold value

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)))))

How can I perform a conditional indirect sum in excel with an if function?

Sample Sheet
Profit
Sales
Expenses
COGS
Hello, I have an array of financial data that I need to turn into profit. I have been able to successfully sum all of the financial together based on a specific date range, but I have encountered a problem with cost of goods sold. Using the match function (apologies if the format is ridiculous, I am new to stackoverflow; the formula is present in the google sheet as well):
=SUM(INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"") &MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)))+SUM(INDIRECT("'Expenses'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))+SUM(INDIRECT("'COGS'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,COGS!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))
I can sum every value on every sheet by row when matching a list of IDs which is constant throughout all data sheets. My problem is: I only want to sum the cost of goods sold sheet to profit ONLY If there is a corresponding sales value in the same location but on the sales tab. Ive tried replacing the sum with sumif to no avail, as I am just getting the hang of this indirect functions. Can anyone provide me with any information that may help me better understand this problem I'd really appreciate it. Thanks
I think that the COGS was meant to be a one time expense per day. That is how all but the first example are calculated.
If so, I believe the correct answer is:
{=SUM(INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)))+SUM(INDIRECT("'Expenses'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Expenses!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))+SUMPRODUCT(IFERROR(INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0))/INDIRECT("'Sales'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,Sales!$1:$1,0),4),1,"")&MATCH(A3,Sales!A:A,0)),0),INDIRECT("'COGS'!"&SUBSTITUTE(ADDRESS(1,MATCH($C$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,COGS!A:A,0)&":"&SUBSTITUTE(ADDRESS(1,MATCH($E$1,COGS!$1:$1,0),4),1,"")&MATCH(A3,Expenses!A:A,0)))}
Without more info I can only come up with that.
=SUM(Sales!B2:I2)+SUM(Expenses!B2:I2)-SUMPRODUCT((Sales!B2:I2<>0)*(COGS!B2:I2))
or
=SUMPRODUCT((Sales!B2:I2)*($C$1<=Sales!B1:I1)*($E$1>=Sales!B1:I1))+SUMPRODUCT((Expenses!B2:I2)*($C$1<=Expenses!B1:I1)*($E$1>=Expenses!B1:I1))-SUMPRODUCT((Sales!B2:I2<>0)*(COGS!B2:I2)*($C$1<=COGS!B1:I1)*($E$1>=COGS!B1:I1))
if dates matters
With the sheet you provided it returns 3.2
Why did you used so much indirect & substitute?
Was it required or fixed ranged fits your need ?

VLOOKUP where lookup value is a day

I'm trying the get the average value out of this table that has a lot of data in it.
I tried to VLOOKUP function but i can't get it to search on day names :(
If someone could help me that would be much appreciated!!
enter image description here
This basically the same as answer already given but for text and for all averages to return
=SUMPRODUCT(--(LEFT($B$2:$B$15,FIND(",",$B$2:$B$15)-1)=$H2),D$2:D$15)/SUMPRODUCT(--(LEFT($B$2:$B$15,FIND(",",$B$2:$B$15)-1)=$H2))
Put in I2 and drag right and down.

Using Excel Formulas to return the count of non zero in a column

I spent half the day racking my brain and playing around with the formulas i know of in the excel world but I still cannot figure out a method to do this without using VBA coding. Hopefully someone out here would be able to help provide some guidance without the use of code.
The scenario is this and refers to the screenshot above:
Objective: Determine the number of non zero values in a particular month's column for every row that has an "exceptions" label.
The month is controlled by the user input cell.
Example:
Total number of non zeros in Feb column is 6.
Actual result that I am expecting: 3 (because there are three rows with "exceptions" label and we should count the total of those rows only.)
I've tried Index/Match/Countifs/lookups but just cannot find the right combination.
Closest I came to was using the screenshot below but that only returns the total number of non zeros in that table.
Just putting the question out there for any of the excel gurus to help.
Appreciate the time and thanks in advance!
Regards,
Stan
If you do not want volatile functions like offset or indirect, you can still do it with index (your formula isn't wrong at all). Just try this:
=COUNTIFS(INDEX(F2:K7,,MATCH(G10,F1:K1,0)),">0",E2:E7,"exeptions")

Resources