Get record from another sheet when value selected from dropdown - excel

I am using Excel 2007
I have two sheets. 1) Orders And 2) Products
Orders :
A B C D E
Sr No particulars quantity rate amount
-----------------------------------------------------------------
1 Dropdown from
Products B2:B50
------------------------------------------------------------------
2 Dropdown from
Products B2:B50
------------------------------------------------------------------
....... And So On.....
Products :
A B C
---------------------------------------------
Sr No ProductName Rate
---------------------------------------------
1 ABC 440
2 DEF 210
3 XYZ 185
...... And SO On...
In Orders Sheet, In Particulars, Dropdown box is generated with productnames in Products Sheet with Data Validation.
I want to autofill Rate of Product Selected from dropdown in Orders sheet
I tried VLOOKUP... But without success

I guess that in your "Product" sheet it will not be duplicated a Vlookup works.
For instance ABC remains 440 as rate? Then you can have your "quantity" x "rate" to get your amount. What have your tried in Vlookup and what error?

Try this in Orders sheet cell D2
=VLOOKUP($B$2,Product!$B:$C,2,FALSE)

Related

Exclude Rows with 0-values from PivotTable without Helper Column

I have the following Excel spreadsheet:
A B C
Quantity Sales Price
1 Product A 500 0
2 Product A 0 5.95
3 Product A 600 19.95
4 Product B 250 0
5 Product B 0 44.99
6 Product C 700 29.99
In Column A you can see different products that can appear several times in the list. In Column B and Column C you can see their quantity and sales price. There can also be cells with value 0.
Now I created a simply PivotTable based on this data which gives me the following result:
Count of Quantity
Product A 3
Product B 2
Product C 1
As you can see the rows that contain 0 values are also in the count.
Since I want to exclude them I inserted a "Helper Column" in the original data with the following formula:
=IF(OR(B2=0,C2=0),"=0","<>0")
This "Helper Column" I use as a Report Filter in the PivotTable.
Well, that solution works so far but is there also a way to avoid the "Helper Column" and do the "Exclude 0-Function" directly in the PivotTable?
Yes.
Add Quantity and Sales Price to your Pivot Report Filter Panel.
In the filter, choose all and then remove 0 from both.
Right-Click each filter and choose Field Settings, and tick "Include New Items in Manual Filter".

VLOOKUP when criteria exists mutliple times in matrix

I have the following Excel spreadsheet:
A B C D
1 Product A 500 Product A 500
2 Product B 800 Product A 700
3 Product C 450 Product A 300
4 Product A 700 Product B 800
5 Product A 300 Product B 400
6 Product C 300 Product B 250
7 Product B 400 Product C 450
8 Product B 250 Product C 300
In Column A and Column B the sales of differnt products are listed. A product can appear several times in Column A because each sale of the product is displayed.
In Column C the different products are sorted from A-C.
In Column D I want to use a VLOOKUP to get the sales from Column B for each of the products.
=VLOOKUP(C1,$A$1:$B$8,2)
However, since the products appear several times in Column A the VLOOKUP gives me only back one of the values.
How do I have to change the VLOOKUP to get each sale of the same product?
You cannot get desired result single VLOOKUP formula.
Use this array formula:
=INDEX($B$1:$B$8,SMALL(IF($A$1:$A$8=C1,ROW($A$1:$A$8)-ROW(INDEX($A$1:$A$8,1,1))+1),COUNTIF($C$1:C1,C1)))
Paste it into D1 and press CTRL+SHIFT+ENTER to change it into array formula, then pull formula down.
Another approach:
Insert one empty row above the data, then put this formula in column D (you can hide this column if you want to):
=MATCH(D2;INDIRECT("$A"& 2 + IF(D2=D1;E1;0) & ":$A$9");0)+IF(D2=D1;E1;0)
And this formula in column E:
=INDEX($B$2:$B$9;E2)
MATCH works similar to VLOOKUP but instead of the actual value returns the index of the result. INDIRECT("$A"& 2 + IF(D2=D1;E1;0) & ":$A$9") alters the searchmatrix based on the previous index of the search value (e.g. the first "Product A" is found at index 1 therefore the second "Product A" only looks in A3:A9, the second "Product A" is at index 4 thus the third "Product A" looks in A6:A9).
The second formula just extracts the value based on the matrix in column B and the index in column D.

compare 2 excel columns with data in adjacent columns

I have seen a few answers which were close to what I am looking for, but can't quite figure it out. I apologize as I am not a programmer, but am tasked with these types of things periodically.
I have a spreadsheet with data in multiple rows. I would like to compare column A with C and have them align, and then the data in B move with column A. (I can rearrange the columns if need be to make this work.
I have this:
Inventory ID# count Original ID# vendor item number
1234 2 1000 vendor 1 1234566
1456 1 1234 vendor 2 546564
7000 3 1456 vendor 3 af4566
2003 vendor 4 56778
7000 vendor 1 788asd
What I want it to look like is after:
Inventory ID# count Original ID# vendor item number
1000 vendor 1 1234566
1234 2 1234 vendor 2 546564
1456 1 1456 vendor 3 af4566
2003 vendor 4 56778
7000 3 7000 vendor 1 788asd
I have tried macros, and VLOOKUP, but can't figure out how to have the count move with the inventory ID # Thank you for your help.
I'll assume your data starts in Sheet1!A1
Move the Invenotry ID# and count columns to a different sheet (say, Sheet2). Then replace the value in cells A2 with the following:
=IFERROR(VLOOKUP($C2,Sheet2!$A:$B,1,FALSE),"")
and similar for cell B2:
=IFERROR(VLOOKUP($C2,Sheet2!$A:$B,2,FALSE),"")
Fill it down. The VLOOKUP will place your id's and counts in the right rows, and the IFERROR( ... ,"") part will put a blank string where there is no match, so it will look like you desired table
If your data starts from cell A1, insert 2 columns C and D like below,
Enter the below formula in cell C2 and drag it right to column D and then down throughout the range,
=IFERROR(INDEX($A:A,MATCH($E2,$A:$A,0),COLUMN(A1)),"")
You can then copy-pastespecial Column C and D to A and B and delete C and D.

excel only show rows with difference values

Hi oh you all wise people.
Not sure if it is doable.. But here goes.
I have a "master" sheet with a set field set (it is the same fieldset I extract every time)
Sheet1:
A B C
-----------
1 B 2 BA
2 C 5 AB
Sheet3:
A B C
-----------
1 B 1 BA
2 C 5 AB
Since B:2 has been changed from 2 to 1, it should result in:
Sheet2:
A B C
-----------
1 B 2 BA
I would like to get the changes between my "master" sheet and the "next extraction" of data.
The challenge (I think) is that I only want the rows with changes displayed in a third sheet.
Sheet1 : Master Data
Sheet2 : Diff Reporting
Sheet3 : Weekly Extraction
Anyone?
Following dot.Py's suggestion, I would:
Copy both row sets to a new sheet
Add a column showing which sheet each row originally came from, let's call it "Source".
Use the 'Remove Duplicates' feature in the Data tab, but do not use the "Source" column as a duplicate criteria. (http://www.excel-easy.com/examples/remove-duplicates.html)
After removing duplicates you'll have both the old and new row for rows that have changed.
Filter based on the "Source" column and then delete any rows from the old sheet.

Updating a column in excel

I have two excel sheets with one column common for both. I need to match the column value and update the next column by following the excel 2.
for example:
I have excel1 as
A B C D
fruits 22 f.market
vegetables 50 v.market
flowers 60 l.market
excel2
A B
fruits 1000
flowers 2000
So, I need to update column D in excel 1 as 1000 where column A is fruits
You can use VLOOKUP() for fetching the respective value. Considering your data value 'fruits' is in cell A1 try to use following function
=VLOOKUP(A1,$A1$B2,2,false)

Resources