How do I parse text in excel? - excel

If my selected fields contain the word "xxx" or "yyy", I want to change those fields to show only those words. If a field doesn't contain either, I want to delete the info in that field.
How can this be done in excel?

I think you might want to use an IF expression here.
For example:
=IF(OR(A1="xxx",A1="yyy"),A1,"no")
If in column A you place xxx, yyy, zzz each in their own row. Then in column B you place this formula and replicate it down to row B3 you should find that if "xxx" or "yyy" is present in the cell then the value is displayed, otherwise "no" is displayed. You could change no in the formula to an empty string "" to get the effect of deleting the contents.
For further reading on the Excel IF expression see http://www.techonthenet.com/excel/formulas/if.php

The worksheet formula you would use to determine if the cell 'contains' xxx or yyy, then perform the action you requested would be:
=IF(NOT(ISERROR(FIND("xxx",A1))),"xxx",IF(NOT(ISERROR(FIND("yyy",A1))),"yyy",""))
However I want to point out that, in this case, "xxx" will override "yyy" in the case where the cell value is, say, 'abcyyydefxxx'...the result would be "xxx".
If there is a chance that a cell could contain both of your strings, I will revise the formula to accommodate that.
Now, the A1's in the formula point at the cell you are checking.

Related

getting value instead of text in within the formula - Microsoft excel

I need a solution for my problem. My problem is, while using "IF" we can set the output as a text, instead can we get the output as one of the cell values?
As I have about 121000 rows, it will be a hell to do it manually.
hope you guys understood the question. sample is enclosed in the image.Image
I have condition with it. If both the cells contain same value or different value, that value in the D Col has to be taken.
Adding "" to the cell value C2 or D2 like "C2" will return the cell address as a text. So your formula should be,
=IF(C2=D2,C2,D2)

Searching an element in a column and "print" it

I'd like to search an element in a column and then use this element in a vlookup formula. My column contains either the same number (i.e : 2300) or nothing (""), but I have 26 different possible number (each number = a company).
I'd like to avoid VBA if possible
Example:
File 1.xlsx, COL A:
""
"2300"
"2300"
""
"2300"
"2300"
...
File 2.xlsx, COL A:
""
"1200"
""
"1200"
"1200"
"1200"
...
So if I'm the File 1.xlsx, I'd like to do the following : "If find something different than "", then print the number".
Hope I'm being clear. Thanks for your help in advance!
Jean
You can't use a vlookup on this kind of data. The value you're looking for must be in column sorted in alphabetical order, then from that, you can retrieve the value present in a cell present on the same line.
If you only want to test if the cell in empty, you could do simply this
=IF(<your cell>="";<you other cell>;"")
Be careful of relative and absolute coordinates.
This formula will return the first non-blank value that doesn't match 2300 in the range A1:A10. Update the range (in all 3 places) as required, and replace 2300 when searching for different values.
=INDEX($A$1:$A$10,MATCH(1,($A$1:$A$10<>"")*($A$1:$A$10<>2300),0))
Note this is an array entered formula. To enter it correctly, you need to double click into a cell so that you're in edit mode, paste the formula then confirm it by pressing CTRL+SHIFT+ENTER

Excel Formula with if, then

I need to write a formula in Excel that performs the following:
If cell A1 contains the text ".png",".jpeg" then cell B1 = Image
If cell A2 contains the text ".mov",".mp4" then cell B2 = Video
And so on...
Also, is it possible to apply this validation with additional validation already applied? Like a list.
Solution
I broke the solution to parts so you won't be shocked by a long line of formula.
What I need to get it to work
Extract the suffix of a string, I've done that using the length of the string in column B and then putting it in column C.
B2=LEN(A2)
C2=IFERROR(RIGHT(A2,LEN(A2)-SEARCH(".",A2)),$J$4)
The IFERROR is in case the file doesn't contain a dot and then column C will show the message in cell $J$4.
Get the type by a so called "database" table which I've built to map which suffix belongs to which type of file
D2=IFERROR(INDEX($F$2:$G$8,MATCH(C2,$F$2:$F$8,0),2),$J$6)
I've used the INDEX and MATCH functions to fetch the data from the database.
The IFERROR in this case means - I didn't find the desired prefix in the Database table (in $F$2:$G$8)
After filling these formulas, drag down the data to the rest of the cells and you'll get the desired results.
Here's an image of my Excel file and below it you'll see the cells mapping to prevent you from guessing where is what.
Cells Mapping
Database = $F$2:$G$8
No Dot string = $J$4
Not a valid suffix string = $J$6
=IF(
OR(ISNUMBER(SEARCH(A1,".png")),ISNUMBER(SEARCH(A1,".jpeg")))
,"Image"
,IF(
OR(ISNUMBER(SEARCH(A2,".mov")),ISNUMBER(SEARCH(A2,".mp4")))
,"Video"
,"")
)
Please check for the closing brackets yourself as I just typed this off my head.
That formular should be used for cell B1

Excel formula: If one thing, give answer; else, give one of two possible answers

I need a formula that will see if the cell contains the words "Daily" or "Weekly" and display a "0", and for anything else, it will check for the presence or absence of a date.
This is my first attempt. I assumed rather than checking specifically for a date, we can just check to see whether or not the cell is blank.
If so, I think this can be accomplished by using a nested IF formula. First we will check for the words "Daily" or "Weekly" then we will check that the cell is non-black.
Assuming the cell we want to check is A1, we can use this formula:
=IF(OR(A1="Daily",A1="Weekly"),0,IF(A1<>"",1,0))
The first IF statement checks for "Daily" or "Weekly" in cell A1 and populates whatever cell the formula is in with a 0 if either of those words are in cell A1. If cell A1 does not contain those words the next step is to check whether or not it is blank. If the cell is not blank (e.g. there is a date) a 1 is returned, otherwise a 0 is returned.
Try this
`
IF(OR(A1="", A1="DAILY", A1="Weekly", NOT(ISNUMBER(DATEVALUE(A1)))),0,1)
`
Remember to format Col A as "Text" data type

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

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.

Resources