Forum Discussion
VLOOKUP, ARRAY, ROW, COLUMN please help!!!
I need a formula that will search the item # from table 1 in table 2 and display the number for each individual category ("inca", "ineb", etc.) The lines that do not have sales I want it to display a blank. For example, line 6 in table 1 should take that item # and find it in table 2 and display the information for each category when it matches. Table #1Table #2 (Pivot table)
6 Replies
Also, when "looking up" from a Pivot Table I'd recommend the attached approach since Pivot Table columns can change and formulas can pull through the wrong data without you even realising
You create 2 helper formulas (a column match and a row match. Then your INDEX formula just brings back the value from the cell with those coordinates.
This formula then still works correctly even if your Pivot table columns are re-ordered or new one is added / disappears or if a new column is inserted in column A of your Pivot Table sheet.
Hi Karla Ruelas,
A SUMIFS formula should solve your problem without the potential #N/A issue from a VLOOOKUP
I've assumed your Pivot Table is on a sheet called Sheet2
=IF( I2="No","", SUMIFS( Sheet2!$B:$B, Sheet2!A:A, $A2) )
- Man Fai ChanIron Contributor
Is the following formula help:
IF($J2>0,VLOOKUP($A2,Table_2!$A:$K, COLUMN(B2),FALSE),"")I assume that the table 2 is stored in a sheet called <Table_2>. However, I notice that your table_2 is a pivot table, I am not sure it works properly.
- Hi Man Fai Chan,
Just a suggestion that the reference to COLUMN(B2) could be quite a risky approach as if a new column is inserted to the left of COLUMN B then the formula will still work but the wrong results will be returned.
If using this approach then you should reference COLUMN(Table_2!B:B) to be a bit safer. However this also will go wrong if someone inserts a column in Table_2 column A.
I'd go with SUMIFS or INDEX MATCH to be a safer.
Just talking from learning this the hard way :)- Man Fai ChanIron Contributor
Dear Wyn Hopkins,
Thanks for sharing.
Cheers
Chan M F
- Karla RuelasCopper Contributorsorry I reposted it to clarify some stuff!