vLookup Match different lookup array - excel

Can someone please advise the correct method to use so that I can dynamically change the Lookup_Array in a Match condition.
The following formula works fine;
=VLOOKUP(F22,A26:O2000,MATCH(A9,A26:O26,0),FALSE)
However based on other criteria I would like the Lookup Array to be different, instead of being A26:026 it would be A34:O34.

From what I understand your question to be, you can use Indirect(). Assuming that cell A1 has A26:O26 (literally typed, in the cell). You can use this formula,
=VLOOKUP(F22,A26:O2000,MATCH(A9,INDIRECT(A1),0),FALSE)
Then, if you want to use another range instead of A26:O26, just replace what's in cell A1.

Thanks guys, i have worked it out for myself please see below if anyone else has the same problem
=IF(J5>=INDEX(TCT.xls!pArray,MATCH(O5,TCT.xls!pGroup,0),5),INDEX(TCT.xls!pArray,MATCH(O5,TCT.xls!pGroup,0),5),J5)
Thanks

Related

condition formatting based on formula's result

I have a cell (AP21) containing a formula, and I want that the AP22 become black if the AP21 return empty string.
I am using conditionnal formatting but I not able to do that, because when I am using a formula to check the value of AP21, it's always considered as not empty because it contains a formula and not a text.
What I need is to evaluate in my AP22 the result of the formula of the cell AP21 and not the formula itself.
Any clue about how to do that please ?
Here is what I have to help you to understand me more
I tried also what is suggested in comments still didn't work
As #BigBen said in comments, you want to compare to an empty string
=$AP21=""

Using “<>” logic in an Excel Sumifs formula.

I apologize in advance if my question is unclear. It’s my first time posting on this forum. I’m trying to write a Sumifs formula in Excel where one of the criteria is to sum everything except a specific value. I write a small amount in SQL and i use the <> function to eliminate specific values. Is there a similar ability in Excel? Thank you for your help!
With SUMIF() or SUMIFS(), you can use <>:
=SUMIFS($A$1:$A$100,$B$1:$B$100,"<>123")
That will check if a value in your B1:B100 range is 123, and if so, will not use that equivalent value in the A1:A100 range.
Microsoft Excel has a NOT function.
So, you would say
=NOT(A2="yourtest")
In this case, it means it returns true if A2 is not the string "your test"
I think that maybe your syntax for the criteria is not correct.
This formula works to exclude the string "A" from the summed results...
=SUMIF($A$1:$A$6,"<>A",$B$1:$B$6)
If you are trying to exclude "A" by referencing a cell that "A" is stored, this will not work. For example
=SUMIF($A$1:$A$6,"<>E1",$B$1:$B$6)
Here is a working example in excel:

Does anyone know what is wrong with my formula in cell E17?

The code could not work well. I do not understand what the mistake is. I wrote a formula in cell E17 and dragged it down to E22, but the formula does not work at all.
Use the forth criterion, Also use MATCH instead of the nested if.
=VLOOKUP(C17,$B$4:$G$7,MATCH(D17,$B$3:$G$3,0),FALSE)

Excel Nesting IF in SumIfs

Ok. So i'm looking to nest IF in my SUMIFS formulas. The only problem i'm having is when one of my referenced cells show FALSE, the formula no longer works. How do i get the formula to completely remove that Criteria from the SUMIFS formula and still work?
Codes i've used.
=SUMIFS(R:R,IF(BE4=TRUE,I:I),IF(BE4=TRUE,BD4),J:J,BD5)
=IF(BE4=TRUE,SUMIFS(R:R,I:I,BD4),0)+IF(BE5=TRUE,SUMIFS(R:R,J:J,BD5),0)
I've even tried breaking the SUMIFS formula into multiple cells, and using IF and INDIRECT to create a working code. Just keeps popping up with #REF error.
Here's that code
=INDIRECT(CONCATENATE(BK1,IF(BE2=TRUE,BK2,""),IF(BE3=TRUE,BK3,""),IF(BE4=TRUE,BK4,""),IF(BE5=TRUE,BK5,""),BK6))
Here's the code that didn't work before the IF.
=INDIRECT(CONCATENATE(BK1,BK2,BK3,BK4,BK5,BK6))
Any help would be greatly appreciated.
Thank you
Mock Sheet
https://www.dropbox.com/s/tl64vbsalcqxqdm/CriteriaIFS.xlsx?dl=0
Try this formula:
=SUMIFS(BK1:BK6,BK1:BK6,">=0")
Please try this formula,
=IF(BE4=TRUE,SUMIFS(R:R,I:I,BD4,J:J,BD5),SUMIFS(R:R,J:J,BD5))
Your formula
=SUMIFS(R:R,IF(BE4=TRUE,I:I),IF(BE4=TRUE,BD4),J:J,BD5)
You are saying:
Sum from column R everything if match in J with BD5 and IF BE4 is TRUE THEN in I IF match with BD5. Well, the error is because, if BE4 is true is returning a string not a range. Instead you could use this:
=SUMIFS(R:R,INDIRECT(IF(BE4=TRUE,I:I)),INDIRECT(IF(BE4=TRUE,BD4)),J:J,BD5)
And it will be ok, until BE4 is FALSE. because the INDIRECT function return an #REF!... and will be a mess.
I'm not sure if I get the whole idea, but please tell me if you need an emprovement.
Edit #1
Reading your comments I think this could help:
=IF(BE4=TRUE,SUMIFS(R:R,I:I,BD4),0)+IF(BE4=TRUE,SUMIFS(R:R,J:J,BD5))
Try to post some dummie database (using text table format) to give you a better help... and remember to read this: How to ask because your question is to vague, and it was necesary to many comments and answers to "guess" what you really want.
Try this array formula:
=SUMIFS(N:N,IF($A$2,E:E,T:T),IF($A$2,$C$2,""),IF($A$3,F:F,T:T),IF($A$3,$C$3,""),IF($A$4,H:H,T:T),IF($A$4,$C$4,""),IF($A$5,I:I,T:T),IF($A$5,$C$5,""))
It is an array formula and must be confirmed with Ctrl-Shift-Enter.
This is based on your data sheet provided. You will need to change the references to your sheet. The column T reference should be a column that is empty.
I needed to do the same thing. The formula needed to look at a different column as Criteria_Range2 depending on product. I put an IF statement for both the Criteria_Range2, and for the Criteria2 because each column had slightly different information. Basically, it tells the formula use column C (in another worksheet) as the Criteria_Range2 if the product category is anything other than Ceilings. If it is Ceilings, it uses column A as Criteria_Range2. On my worksheet, Column A is a "helper column" that groups our Ceilings sub-products into Tile and Grid.
Hopefully this isn't too confusing, but it works for me and I didn't easily find anything else out there showing how to use IF statements in the Criteria Ranges in the SUMIFS. (I suggest ignoring the very ugly xlookup defining the sum_range.)
SUMIFS(XLOOKUP($AF$20&"COGS CM MTD",Fact_Sales!$E$6:$CS$6&Fact_Sales!$E$7:$CS$7,Fact_Sales!$E$8:$CS$928),Fact_Sales!$B$8:$B$928,'Report Draft'!$AE27,IF('Report Draft'!$AD27<>"CEILINGS",Fact_Sales!$C$8:$C$928,Fact_Sales!$A$8:$A$928),IF('Report Draft'!$AD27<>"CEILINGS",'Report Draft'!$AD27,'Report Draft'!$AF27))

Difficult vlookup formula using cell value and wildcards

I am trying to pull data in Excel using vlookup, but I need to use a cell value and a wildcard. I have tried all of the syntax I can think of with no luck. The current formula is:
=IF(ISNA(VLOOKUP(A640,OpenIPB!A:B,1,FALSE)), 0, VLOOKUP(A640,OpenIPB!A:B,2,FALSE))
The problem is the value in A640 is "102-2028" and the value in OpenIBP that I need it to match with is "102-2028 - RA# 131009-43" Can anyone help me with this? I'm sure there is a cleaner way to go about this, but I'm stuck. Thanks.
Yes, you can use a wildcard in VLOOKUP, just change lookup value to A640&"*"
You can simplify formula with IFERROR if you are using Excel 2007 or later, i.e.
=IFERROR(VLOOKUP(A640&"*",OpenIPB!A:B,2,FALSE),0)

Resources