I have 2 formula's that work fine in XL2010, but not in XL2003, I figured out that COUNTIFS are the problem.
Could someone help me convert them so I can use them in both versions of XL
This is one of the XL2010 codes:
=COUNTIFS(CXPATS!I:I,">="&EOMONTH(TODAY(),-4)+1,CXPATS!I:I,"<"&EOMONTH(TODAY(),-1)+1)
Below is one of my many attempts using SUMPRODUCT, but they either don't work or continually show #NUM!
=SUMPRODUCT(--(CXPATS!I:I>=EOMONTH(TODAY(),-4)+1,--(CXPATS!I:I<EOMONTH(TODAY(),-1)+1))
This is the other XL2010 code:
{=SUM(COUNTIFS(CXPATS!L:L,{"6859*","685A*"}))}
...and one of my many attempts using SUMPRODUCT again, but again I keep getting #NUM! on most attempts
=SUMPRODUCT(--(CXPATS!L:L="6859*"),--(CXPATS!L:L="685A*"))
You cannot reference whole columns using SUMPRODUCT so I used a DNR instead (shown below as DATES in the code) to get the exact range and the formula now works:
=SUMPRODUCT(--(DATES>=EOMONTH(TODAY(),-4)+1),--(DATES<EOMONTH(TODAY(),-1)+1))
Related
I am a beginner at using Excel and I've been trying to code a particular condition. The condition is as follows,
If A<75 and B<75 then do nothing
If A>75 and B<75 then A-75
If A<75 and B>75 then B-75
If A>75 and B>75 then (A-75)+(B-75)
Here, A and B are numerical values in two different cells.
So I wrote a formula and it works when the IF statements are not nested. However when I combine the formula it gives me an error. The formula I wrote is as follows.
=IF(AND(S180<75,V180<75),0,"-",IF(AND(S180>75,V180<75),S180-75,"-",IF(AND(S180>75,V180<75),S180-75,"-",IF(AND(S180>75,V180>75),(S180-75)+(V180-75),"-"))))
The formulae that work are as follows,
=IF(AND(S180<75,V180<75),0,"-")
=IF(AND(S180>75,V180<75),S180-75,"-")
=IF(AND(S180>75,V180<75),S180-75,"-")
=IF(AND(S180>75,V180>75),(S180-75)+(V180-75),"B")
I want the conditions to all be applied in a single cell so that I can switch the resulting value into standard values from another table using the =switch function. I am using Excel Online. Any help fixing my formula is welcome.
Thanks in Advance!
With IF, but could be shortened:
=IF(AND(S180>75,V180>75),S180+V180-150,IF(AND(S180>75,V180<75),S180-75,IF(AND(S180<76,V180>75),V180-75,IF(AND(S180<75,V180<75),""))))
Do you have a recent version of Excel with the IFS function?
=ifs(AND(S180<75, V180<75), 0, AND(S180>75, V180<75), S180-75, AND(S180>75, V180<75), S180-75, AND(S180>75, V180>75), (S180-75)+(V180-75), TRUE, "B")
If you try this formula and end up with a #NAME? error then your version does not support IFS.
Try this nested IF ,
To nest IF you need to include another IF in the FALSE condition of the first IF
=IF(AND(S180<75,V180<75),0,IF(AND(S180>75,V180<75),S180-75,IF(AND(S180>75,V180<75),S180-75,IF(AND(S180>75,V180>75),(S180-75)+(V180-75),"-"))))
I am having trouble at the moment finding a function to search through an array of cells in excel in order to count the amount of times a cell contains two words.
e.g. The functions I have tried so far:
=COUNTIF([array],AND("text1","text2"))
and
=COUNT(IF(ISNUMBER(SEARCH("text1",[array])*SEARCH("text2",[array])),1,0))
or
=SUM(IF(ISNUMBER(SEARCH("text1", [array])*SEARCH("text2",[array])),1,0))
So I was hoping for feedback if there is a different/easier way to do this or if there are errors in constructing my excel functions.
Try COUNTIFS with wildcards, I.e
=COUNTIFS(A:A,"*text1*",A:A,"*text2*")
As a side note:
For those of us who still hang around with ancient Excel versions: the following will work even with Excel 2003:
=MMULT(TRANSPOSE(IF(ISNUMBER(FIND("text2";A1:A200));1;0));IF(ISNUMBER(FIND("text1";A1:A200));1;0))
You have to confirm the formula input with <cntrl><shift><return> for it to become a matrix formula, otherwise it will not work.
I am attempting to use sumproduct in replace of sumifs so I can use multiple criteria within a single range. What works so far is:
=SUMPRODUCT(Table2[Sum of MKTValue],--ISNUMBER(MATCH(Table2[Code],{"EG1","EG2"},0)),--ISNUMBER(MATCH(Table2[Currency],{"GBP","USD","EUR"},0)),(Table2[Final Date]=INDIRECT("J"&SUM(ROW()-102)))*1)
However I need the "J" column reference, when I attempt to drive this using the current column as below:
=SUMPRODUCT(Table2[Sum of MKTValue],--ISNUMBER(MATCH(Table2[Code],{"EG1","EG2"},0)),--ISNUMBER(MATCH(Table2[Currency],{"GBP","USD","EUR"},0)),(Table2[Final Date]=INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","")&SUM(ROW()-102)))*1)
Then I am getting a #VALUE error. I have tried a number of different varieties of the above but I cannot get it to work.
Thanks for your help.
I assume that Jn contains a valid date - try moving the SUM function to outside INDIRECT, i.e. with last criterion
(Table2[Final Date]=SUM(INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","")&ROW()-102))*1
I am a novice at Excel and need some help with a formula. I have a set of cells that are the sum of a formula. They are based on information from month to month. At times this can be zero. I want to average them out and am using this formula =AVERAGE(IF(F17:Q17<>0, F17:Q17,"")). That works fine. But, I want it to display 0 if there are no values other than 0, instead it shows #DIV/0! Any ideas?
a simple way is to =if(sum(F17:Q17)=0,0,average(if(F17:Q17<>0,F17:q17,""))) there's also the 'averageifs' statement you should be using to make life simpler.
the IFERROR wrapper will take care of that problem. It's am optimized version of IF(ISERROR(formula)....
Your formula would then be
=IFERRROR(AVERAGE(IF(F17:Q17<>0, F17:Q17,"")),0)
note that this will hide all errors, so make sure your formulas work as expected first, before putting the IFERROR around them.
I've got an issue in Excel that I can't seem to work out:
I'm using SUMPRODUCT() function to calculate a sliding-scale commission. I've got the basics of it worked out by reading this page: http://www.mcgimpsey.com/excel/variablerate.html
which states that I can work out commission as so:
=SUMPRODUCT(--(A1>$J$2:$J$5), (A1-$J$2:$J$5), $L$2:$L$5)
Where A1 would be the gross amount, J2:J5 would be a range of thresholds and L2:L5 the different rates of commission on those thresholds.
I've got the formula working on a single test case, but when I try and factor out the variables into cell references and ranges it fails and returns #VALUE!
e.g. It fails when I use the following formula:
=SUMPRODUCT(--(C17>$C7:$E7),(C17-$C7:$E7),commissionPercentages)
or
=SUMPRODUCT(--(D17>$C7:$E7),(D17-$C7:$E7), R11:R13 )
both of which refer to three adjacent cell containing percentages.
However, if I hard-code the percentages as an array constant:
=SUMPRODUCT(--(C17>$C7:$E7),(C17-$C7:$E7),{0.05,0.05,0.1})
Then it works...
It also works in my test case where all the arguments are named references:
=SUMPRODUCT(--(testRevenueAmount>thresholds),(testRevenueAmount-thresholds),commissionPercentages)
I don't understand why this is happening, and what I've done wrong.
Could anyone enlighten me?
There is a simplified version of my spreadsheet here if you would like to see what I am attempting.
http://diggory.net/Grazing/CommissionSample.xlsx
Thanks.
You can also use MMULT function to avoid "array entry", i.e.
=MMULT((C17>$C7:$E7)*(C17-$C7:$E7),commissionPercentages)
As you commented, the different orientations is the issue.
You can work around this problem by adding a Transpose to your formula
=SUMPRODUCT(--(C17>$C7:$E7),(C17-$C7:$E7),TRANSPOSE(commissionPercentages))