SUMIFS (or criteria using cell reference) - excel

I have a SUMIFS formula like this:
=SUM(SUMIFS(DATA!A1: A5000", .. others conditions .., DATA!R1:R5000,"{<=2017/06/05"," "}) this works great, but we need
to replace the date with a cell reference.
Something like this: "{<=E12"," "}.
We can't change SUMIFS since this is not allowed by the client.

Try this, Concat the text with cell using &
=SUM(SUMIFS(DATA!A1:Z5000", ... , DATA!R1:R5000,"{<=" & E12 ," "})

=SUMPRODUCT(SUMIFS(DATA!A1:A5000,DATA!R1:R5000,CHOOSE({1,2},"<="&E12," ")))
Regards

Related

Excel formula concat text in excel without zero values

I am new to excel formulas.
How to skip the zeros and the show result in image format with the yellow colour columns in the excel formula?
If the results are not always in ascending order (if they are #Solar Mike has already solved it for you with MAX) then perhaps:
=A2&" "&LOOKUP(2,1/(B2:D2<>0),B2:D2)
As per your sample data it seems simple below formula should work.
=A2&" "&MAX(B2:D2)
Or can try-
=A2 & " " & XLOOKUP(1000,B2:D2,B2:D2,,-1,-1)
and if you want actually non zero right cell data (including text data) then use FILTERXML() like-
=A2& " " & FILTERXML("<t><s>"&TEXTJOIN("</s><s>",TRUE,FILTER(B2:D2,B2:D2>0))&"</s></t>","//s[last()]")
Looking at your results however, then this:
Something like:
=if(A2>0,A2&" ","")&if(B2>0,B2&" ","")&if(C2>0,C2&" ","")&if(D2>0,D2&" ","")
will work.
Probably could be made shorter... And should work with all versions of Excel.
Ba

How to use a variable instead of Hard-Coding in v lookup

In the below Vllokup function.
I want to use a variable instead of using hard-coded value as "No Category"
=IF( ISNA( VLOOKUP(Param)),"No Category", IF(LEN(VLOOKUP(Param)) =0,"", VLOOKUP(Param) ))
I tried like the following way , unfortunately i can't make it.
=IF( ISNA( VLOOKUP(Param))," & VarCategory & ", IF(LEN(VLOOKUP(Param)) =0,"", VLOOKUP(Param) ))
Many Thanks
You can use a cell in your spreadsheet as a search box. For example, say you pick cell A1 as the box that can contain whatever you type into it. Your formula can then say:
=IF( ISNA( VLOOKUP(Param)), A1 , IF(LEN(VLOOKUP(Param)) =0,"", VLOOKUP(Param) ))
Now your VLOOKUP is no longer hard coded. It will look based on whatever is in cell A1.

Google Sheets dont return value if both cells blank

I have this formula in Google Sheets
If both cells are blank, I would like to return a blank cell
=if(D2="",B2 &"A" ,D2)
How I can do that or the equivalent in Excel?
ID ID1 ID_NEW
26841 26841A
26842 26842A 26842A
25584 25584A
You can use follwing formula for this:
=IF(AND(ISBLANK(F1);ISBLANK(G1));"blank";"non blank")
Obviously, you need to put "" instead of "blank" :-)
or you might use a reference to F1 (which would yield following formula: =IF(AND(ISBLANK(F1);ISBLANK(G1));F1;"non blank")).
try this:
=if(countif(C2:D2,"*")=0,"",if(D2<>"",D2,C2&"A"))
Hope it helps!

Excel Formula For If

Ok. I'm Having A Problem With A formula That Seems Really Basic. It Uses The If Function. Here's What I Need.
If(b2:b50<>"",IF(b2:b50"607734",e2:e50="Patriot"))
So Basically If Between b2-b50 Has The Number "607734" I Want e2-e50 To Display "Patriot"
You need to put the IF statement in the cell where you want the value. For example, in E2, enter =IF(B2="607734", "Patriot", "") and drag it down to E50.
For each cell you have to enter the formula, which goes like this.
If(logical_test,value if true, value if false)
So, if b2 =607734 then c2 = "Patriot" else c2= " "
Now as formula we can write this as
if(b2=607734,"Patriot","")
similarly, for other cells(c3,c4,c5,c6....c50) we have formula in each cell as :
if(b3=607734,"Patriot","")
if(b4=607734,"Patriot","")
if(b5=607734,"Patriot","")
if(b6=607734,"Patriot","")
........
........
if(b50=607734,"Patriot","")
Your IF statements don't satisfy the else conclusion.
The format of an IF statement in Excel is as follows:
IF(parameter, what to do if parameter is true, what to do if parameter is false).
Right now you've filled in the first two variables for the IF command, but you left the third blank.
e.g.
Could have:
If(b2:b50<>"",IF(b2:b50"607734",e2:e50="Patriot", " ")," ")
And in that case it would put a space in the cell if the first two conditions are not met.

Dynamic formula with quotes inside a COUNTIFS function

I am trying to adapt the following formula (counting instances of values between 0 and 24):
=COUNTIFS(cancellations!AG2:AG408,">0",cancellations!AG2:AG408,"<24")
(formula evaluates to 75), to something like:
=COUNTIFS(cancellations!AG2:AG408,">0",cancellations!AG2:AG408,INDIRECT("" & "<" & B1*24 & ""))
but this evaluates to zero. (B1 = 1 in the above example.)
When I view the INDIRECT function inside the fx box it evaluates correctly. Not sure of what I am doing wrong.
When applied in a cell like so:
=INDIRECT("" & "<" & B1*24 & "")
It shows #REF!.
The INDIRECT function returns a reference to a range. You can use this function to create a reference that won't change if row or columns are inserted in the worksheet. Or, use it to create a reference from letters and numbers in other cells.
=COUNTIFS(cancellations!AG2:AG408,">0",cancellations!AG2:AG408,B1)
should work where B1 contains <24.
So, I read up the COUNTIFS() function in more detail and I found that the following works
=COUNTIFS(cancellations!AG2:AG408,">0",cancellations!AG2:AG408,"<"&B1*24)
Where:
B1=1

Resources