Searching for data on another sheet

thevaper

New Member
Joined
Mar 1, 2021
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hello

I need help in creating a log for our business. Basically, we have different pricing for our physical store and online store. I'm trying to get a formula to work on a cell that will look for the price of the online/physical store when I input a code. Please see the details below.

thread-100342838-2542662533610469916.JPG


thread-100342838-2542662533610467969.JPG


The first screenshot is on Sheet 1 which is the main page where we log the sale. What we want to do is on F2. We're looking for a formula that would use the code on B2 (P=Physical store - column c on sheet 2, O=online store - column D on sheet 2), to look for the price of the product code on sheet 1 C2. For example 2nd row should pull the price of $5 (from sheet 2 c3) when B2 is P and the product code on C2 is entered.

Thank you for your answer
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
How about
Excel Formula:
=IF(B2="P", VLOOKUP(C2,Sheet2!A2:D2,3,0)*E2,VLOOKUP(C2,Sheet2!A2:D2,4,0)*E2)
 
Upvote 0
Hi,

Here's one way.

You didn't specify if the "Quantity" is a factor, so I included both, Change Sheet810 to Sheet2:

Book3.xlsx
ABCDEFG
1PlatformCodeQuantityPricew/ Quantity
2PAJ1155
3OAJ1144
4POJ155.527.5
5OOJ194.540.5
6  
Sheet807
Cell Formulas
RangeFormula
F2:F6F2=IFERROR(INDEX(IF(B2="P",Sheet810!C$1:C$10,Sheet810!D$1:D$10),MATCH(C2,Sheet810!A$1:A$10,0)),"")
G2:G6G2=IFERROR(INDEX(IF(B2="P",Sheet810!C$1:C$10,Sheet810!D$1:D$10),MATCH(C2,Sheet810!A$1:A$10,0))*E2,"")


Book3.xlsx
ABCD
1CodePrice PhysicalPrice Online
2AJ1$5$4
3OJ1$5.50$4.50
Sheet810
 
Last edited:
Upvote 0
Adding another way for VLOOKUP, again change Sheet810 to Sheet2:

Book3.xlsx
ABCDEFG
1PlatformCodeQuantityPricew/ Quantity
2PAJ1155
3OAJ1144
4POJ155.527.5
5OOJ194.540.5
6 
Sheet807
Cell Formulas
RangeFormula
F2:F5F2=IFERROR(VLOOKUP(C2,Sheet810!A$2:D$10,IF(B2="P",3,4),0),"")
G2:G6G2=IFERROR(VLOOKUP(C2,Sheet810!A$2:D$10,IF(B2="P",3,4),0)*E2,"")


Book3.xlsx
ABCD
1CodePrice PhysicalPrice Online
2AJ1$5$4
3OJ1$5.50$4.50
Sheet810
 
Upvote 0
@Michael M and @jtakw Thank you so much for the answer. The formula worked pretty well. We just made some adjustments to match the range on our file. You guys are great! :):):)
 
Upvote 0
Glad WE could help.. (y) (y) .as a matter of interest, which formula did you go with ??
 
Upvote 0
You're welcome, thanks for feedback, glad we can help.
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,680
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top