Product With SUMIF Function When Using ROUND Function - excel

I'm trying to find a way to get the same results as the following function, but without using SUMPRODUCT, since SUMPRODUCT is not supported in Documents To Go for iPhone.
=SUMPRODUCT(($D$2:$D$50000="O")*ROUND($C$2:$C$50000,0))
I have tried using SUMIF and SUMIFS, but both result in errors. Neither likes the use of the ROUND function.
=SUMIF($D$2:$D$50000,"O",ROUND($B$2:$B$50000,0))
=SUMIFS(ROUND($B$2:$B$50000),$D$2:$D$50000,"O")
Thanks in advance!

I have tried using SUMIF and SUMIFS, but both result in errors. Neither likes the use of the ROUND function
That is because SUMPRODUCT can take in array values while SUMIF cannot.
I'm trying to find a way to get the same results as the following function, but without using SUMPRODUCT, since SUMPRODUCT is not supported in Documents To Go for iPhone.
I do not see a way to implement that exact functionality without having the formula or changing the spreadsheet slightly.
You can get close by using =ROUND(SUMIF($D$2:$D$50000,"O",$C$2:$C$50000),0) which will round the end value instead of each individual value.
However you could change the spreadsheet by making another column (lets say E) that is just the rounded version of column C and use =SUMIF($D$2:$D$50000,"O",$E$2:$E$50000)
Or you could make a custom function that implements the same functionality as SUMPRODUCT and use that.

In Excel you can use an "array formula" like this
=SUM(IF($D$2:$D$50000="O",ROUND($C$2:$C$50000,0)))
Not sure if Documents To Go will support array formulas? In Excel that formula needs to be confirmed with CTRL+SHIFT+ENTER

Related

excel use formula results in another formula

I have this formula:
=UNIQUE(A1:A100)
I would like to use the results of formula =ROW(OFFSET(A1,COUNTA(A:A)-1,0)) in order to get the row number and use it in the UNIQUE formula, to get the changes dynamically.
the results should be: =UNIQUE(A1:A&*<results of =ROW(OFFSET(A1,COUNTA(A:A)-1,0))>*)
I need to use vba, or there is a way without it?
OFFSET has a height parameter, you could use that instead directly: =UNIQUE(OFFSET(A1,0,0,COUNTA(A:A)-1,1))

Using Indirect with SumProduct

Following this question, I am trying to implement the SUMPRODUCT(ABS()) formula to include an INDIRECT. The reason for this is that I want to run the calculation for each combination of employees. Row 2 now contains a list of all employees and column A contains the same list of all employees. I'm attempting the following formula in cell B3. I am getting a #VALUE error:
=SUMPRODUCT(ABS(INDIRECT("Sheet1!J"&ROW(A3)-1&":BB"&ROW(A3)-1)-INDIRECT("Sheet1!J"&COLUMN(B2)&":BB"&COLUMN(B2))))
ABS in older version outside Office 365 does not like to use arrays and as such we must "force" it to use arrays with N().
Also avoid INDIRECT if possible as it is volatile and will cause calc slow down.
=SUMPRODUCT(ABS(N(INDEX(Sheet1!J:BB,ROW(A3)-1,0)-INDEX(Sheet1!J:BB,COLUMN(B2),0))))

Excel vlookup and if

Ok so I am fairly new to using excels formula functions and I am still learning. What I am trying to do is combine two statements both work independently but I need them together. the two statements are an if statement and a vlookup and are as follows
=IF(C5>=$J$4,"YES","NO")
=VLOOKUP(C6-500,$H$5:$I$8,2)
The vlookup needs to take the spot of the yes part in the if so I don't get the error message that get because some values are below the threshold for the vlookup but I want to simply say that they are not valid hence the if statement.
If there are any better ways to do this I am all ears.
If you want to put VLookup() in the yes part then put the formula as below.
=IF(C5>=$J$4,VLOOKUP(C6-500,$H$5:$I$8,2),"NO")
If you want to control errors by formula then use IFERROR() function. Like
=IFERROR(IF(C5>=$J$4,VLOOKUP(C6-500,$H$5:$I$8,2),"NO"),"")
IFERROR() with VLookup() only.
=IFERROR(VLOOKUP(C6-500,$H$5:$I$8,2),"")

COUNTIFS with greater than TODAY OR blank cell

I have a question regarding COUNTIFS. The simple boiled down version of what I am trying to do is this:
I am trying to use COUNTIFS to count the number of entries that the cell in a column is either blank or in the future (greater than today) and that is marked with an “X” in another column.
There are several other renditions in the formula but if I can get this, I can get the rest. So far, I have this:
=SUM(COUNTIFS($C$2:$C$50,{"";">"&TODAY()},$E$2:$E$50,"X"))
Excel won’t let me return out of the formula and highlights the quotation mark following the greater than symbol.
=SUM(COUNTIFS($C$2:$C$50,{"";">100"},$E$2:$E$50,"X")) works fine when I play around and test things but when I try to add in &TODAY() or reference a cell, things go sideways.
Any suggestions as to what I am doing wrong? The actual formula is quite long and there are several comparisons that are made between columns. I've seen some references to using SUMPRODUCT but haven't been able to figure it out that way either.
You can use a formula to generate the criteria array, i.e.
=SUMPRODUCT(COUNTIFS($C$2:$C$50,IF({1;0},"",">"&TODAY()),$E$2:$E$50,"X"))
I used SUMPRODUCT in this version because with SUM you'd need CTRL+SHIFT+ENTER
The IF function generates an array that resolves to something like this:
{"";">43060"}

How do you do sumif with equation?

Basically, I want to do a SUMIF, but I need to enter an equation for sum_range parameter, so normally, to do a SUMIF, you write:
=SUMIF(CRITERIA_RANGE,CRITERIA,SUM_RANGE)
This is great, but what if I need to do some calculation in my summation? So for example:
=SUMIF(CRITERIA_RANGE,CRITERIA,COL1*COL2)
Is something like this possible?
SUMPRODUCT is commonly used in this case
Eg
=SUMPRODUCT((CRITERIA_RANGE=CRITERIA)*COL1*COL2)
A different answer (NOT FOR POINTS).
Explanation
The reason why you cannot use SUMIF in your scenario is because SUMIF cannot handle Arrays as sumproduct does and hence I would go with Chris's suggestion of using SUMPRODUCT
Alternative
Here is one more way to achieve what you want.
=SUM(IF(CRITERIA_RANGE=CRITERIA,COL1*COL2,""))
ScreenShot
Please note that this is an ARRAY FORMULA which means that instead of pressing ENTER, you have to press CTRL+SHIFT+ENTER

Resources