Excel Help - If Cell A1 = "123456", Cell B = "Product Description" - excel

I need help with setting up a formula so that excel produces a product description in one cell if the PO number is entered in the previous cell...
I.e if cell A1 = 123456 then I need Cell be to produce the product description "TELEPHONE" I would need this formula so that I can add additional PO's and products descriptions as we have 100+ items and I don't wish to keep typing the product name when I can hopefully use the PO number in the previous cell?

Store all your product description and its code in say sheet 'Data'.
use the below formula in cell B1 and copy the same on all required cells in B column
=IF(A1="","", VLOOKUP(A1,Data!A:B,2,FALSE)

Most likely you want to use if() function.
And most likely you want to know if in cell A there is number. For that you can use function isnumber().
Example of function:
=if( isnumber(A1), "TELEPHONE", "" )
If you want to check for different descriptions, instead of "", add another if() function.
If you are checking for full match, use vlookup() insted of if().
P.S. To be honest it is hard to understand, your problem.

Related

How do I match two conditions to return a value without a helper column

I'm working on a pretty big data set. It's got two sheets. The first one contains the name of one city and multiple ID numbers. The second sheet should be left alone/unedited (raw data). It contains multiple cities and multiple ID numbers (some of them are in the first sheet and some are not).
I want something like: if city in sheet 1 and ID number in sheet 1 is in sheet 2, then return "Ok". Preferably without any helper columns.
An example:
Sheet1
City ID Status,
Londen 12345 OK,
12346 OK,
Sheet 2
City ID,
Londen 12345,
Mumbai 12333,
Londen 12346,
I've tried something like
=INDEX(Sheet2!A:B,MATCH(B2,Sheet2!B:B,0),0)
But I have not figured out yet how to add another condition and add the "OK".
I thought of using VLOOKUP, but I got stuck there too since I don't want to use helper columns
Thanks in advance!
You can use SUMPRODUCT function to check if both criteria are met in your Sheet 1. i.e. City = Londen and ID is shown on Sheet 2.
In my solution I have named the City column in Sheet 2 as Master_City, and named the ID column in Sheet 2 as Master_ID.
Presume you have the city name in cell A2 on Sheet 1, and ID is listed in Column B, then you can use the following formula to get the result:
=IF(SUMPRODUCT((Master_City=$A$2)*(Master_ID=B2))>0,"Ok","No Match")
Please note I have changed your example data a little bit to test the result. And I have set "No Match" for ID that is missing on Sheet 2. You can show a blank cell by replace "Na Match" in the formula with "" if needed.
You can read the following article regarding the use of SUMPRODUCT in varies situations to help to understand my answer better.
Master Excel’s SUMPRODUCT Formula
See below screenshot for more clarifications. Let me know if you still have any questions.
Cheers :)

Lookup using multiple columns

I have a sheet filled with data below (and in the image):
Now there's this other sheet where the user will only be inputting the column "Gender" and "Age" values and the excel formula should be fetching the associated factor. Please help me with one such formula.
For e.g. If the user puts Male and 23, the formula should return 3. say Male was entered in Cell D46 and 23 was entered in E46 of Sheet named "Sheet4" and the table shown above happens to be in "Sheet1"
Please advise.
Right, now I can visualize what you meant in your other comments in your previous question, it's a rather easy redo of our other formula.
Formula in F3:
=INDEX(C1:C13,MATCH(1,(ROW(C1:C13)>=MATCH(F1,A1:A13,0))*(B1:B13=F2),0))
Entered through CtrlShiftEnter
Notice that these formulas will return a wrong result if, lets say you extend till females age of 29, and you will search for male, it will still return the value for female. It will however not fail when your searchcriteria would be always right.
You could prevent this in this case (because you only really have one criteria and a fixed range with this formula in F3:
=IFERROR(IF(F1="Male",INDEX(C2:C9,MATCH(F2,B2:B9,0)),INDEX(C10:C13,MATCH(F2,B10:B13,0))),"No result")
Just enter normally. What it does is it checks what gender type is chosen and choses it's lookup index accordingly.
Another option would be to use SUMPRODUCT() like so :
=IF(F1="Male",SUMPRODUCT((B2:B9=F2)*(C2:C9)),SUMPRODUCT((B10:B13=F2)*(C10:C13)))
Also, if you are curious what formulas do and want to learn from them, a great way to do so is using the build-in formula evaluate function, that will show you step by step what the formula will calculate.
EDIT
Tried, as per your comment, to break it down for you so you understand what is going on:
For situations like this, I've learned a good trick how to fill in the blank cells:
Select all cells in the column with the "gender" values.
Goto Special, Blanks. (You active cell should be A3)
In the formula bar, type =A2. (I believe that A2 contains the word "Male")
Press Ctrl+ENTER (don't forget the Control key for filling all selected cells)
As a result, A3 will be copied from A2 and contain the word "Male", A4 will be copied from A3 and will now also contain the word "Male", ...
Further: this stops at the first occurence of the word "Female" (this cell is not selected), and for the later cells, the copying happens in the same way as before.
From here, it should be far easier to achieve your goal.

Reference a value (string) of a formula and check whether cells (sentences) contains the value

I am currently trying to create an Excel formula to check whether cells containing some sentences contains a specific word.
Tricky part is that I want to read the value of another formula for the word to be checked. Example below:
A B
1 Apple Amanda wants to buy some apple...
2 Orange The price of orange in current market...
Where the content of A1 came from a formula. I am trying to create a formula to check whether B1 contains A1.
And I currently have
Formula 1 = CELL("contents",A1) // To get cell content
Formula 2 = COUNTIF(B1:B2,"*Apple*") // To find whether "Apple" appears
But I cant combine these two formulas to create...
COUNTIF(B1:B2,"*CELL("contents",A1)*") // Results I am trying to get
Can any Excel wiz help me with this please? Ideally I am looking for a method without having to result to Macro.
Thanks
Maybe this works for you:
=COUNTIF(B1:B2,"* " & CELL("contents",A1) & " *")
Since you want Apple as a wildcard ("*Apple*"), you can wrap the result from first formula as a wildcard by "*" & formula & "*" and entering it in the second.
Why not =SEARCH(A1,B1)? If an error is returned, the value is not found.
=IFERROR(SEARCH(A1,B1),"Not found")
Or COUNTIF() with wildcards:
=COUNTIF(B1,"*"&A1&"*")

Excel: Unique codes referencing properties of each product on an invoice

I have been generating invoices by manually inputing the information for each product.
What I would like to do is type in a unique product code (E.g., "01-A") and in the same row automatically return the color, size, price, etc. ("properties") of the product.
I have a separate "database" sheet with these data and the product code in the same column.
I have attached a graphical example illustrating this idea.
Thank you very much for your assistance!
You need a lookup - in this case a VLOOKUP.
=VLOOKUP(Value you want to look up, range where you want to lookup the value, the column number in the range containing the return value, Exact Match or Approximate Match – indicated as 0/FALSE or 1/TRUE).
For example:
=VLOOKUP(B5, Sheet2!$C$2:$G$50, 2, FALSE)
Where B5 is the product code you enter, Sheet2!$C$2:$G$50 is the table with the product details on the other sheet, 2 means the second column (i.e. size), and FALSE to say only lookup if there is a match.
See the Microsoft reference.
Assuming your Sheet1 is as follows
Then, in Cell B5 of Sheet2 enter the following formula
=IFERROR(VLOOKUP($A5, Sheet1!$A$5:$D$7, COLUMN(B$1)-COLUMN($A$1)+1, FALSE),"")
Drag/Copy this formula down and across (to right) as required. See image for reference.

Excel: How to have an IF function return the value of the cell from another sheet

This is sort of a carry on from my previous question. I have a sheet named Car Search which returns the details of a car from the Raw Data sheet when the Car ID is entered (see image 1).
I would like the Notes column to return what is in the Raw Data sheet in that specific cell. This is dynamic; so if the cell was F561, then I would like it to return that exact cell.
So for example, when I enter the Car ID '2613' into the Car Search sheet, I would like column E5 to return the value of the specific cell in the Raw Data tab. (Currently, that cell is F5 which is 'here2').
Is there a formula that can do this? Or am I missing something in the current formula?
My current formula is this: =IF(INDEX('Raw Data'!E:F,MATCH($B$3,'Raw Data'!A:A,0),MATCH(E2,'Raw Data'!1:1,0))="","")
Any help appreciated :)
Try this untested formula:
=""&INDEX('Raw Data'!$F:$F,MATCH($B$3,'Raw Data'!$A:$A,0))
Your Index() formula is searching within E:F, but the column index you supply is actually identical with the column id. So change this to A:Z.
Also, I'd suggest some "$" since it looks like you wish to drag this formula:
=""&INDEX('Raw Data'!$A:$Z,MATCH($B$3,'Raw Data'!$A:$A,0),MATCH(E$2,'Raw Data'!$1:$1,0))
Wrapping it with IF(Result="","",Result) is kind of redundant - it serves no function.

Resources