Excel: replacing an abbreviation with a string of text - excel-formula

I'm having trouble with using replace/substitute to auto replace an abbreviation with lines of text.
To make it easier for my crews to input their work, simply typing "wc" should be autofilling as "White Can 20L 308728"
We have various products with product codes to input but everything I'm finding references an already existing cell or replaces already existing text.

Suggestion is to tabulate these products with their product codes and apply a VLOOKUP function to return the appropriate product description when a user types in a certain code. Limitation of this would be that the cell in which the worker would type in a code would not be the same cell that returns the appropriate product description for that code.
So assuming you have your list of product codes and description in Sheet2 - columns A (it is essential that this should be the product codes) and B (product description), and you want the formula to run in sheet1, you can use the following formula:
=VLOOKUP(A1,Sheet2!$A:$B,2,0)
This assumes that you'll be encoding your code in cell A1 of Sheet1 (or any sheet other than your reference sheet).

Related

If cell contains text from a range of other cells

I am working on a project where the aim is to categorize spending on bank statements based on their description. Bank statements are uploaded onto an excel spreadsheet each month, which then should look at the description of each spend and assign it to a category.
There are 75 spend categories listed out in a row, and under each category there is a list of text against which the description of the spends on the bank statement needs to be matched. If the description contains text from a cell, the function should say which category that particular cell is under.
$K$3:$CG$3 is where I have the names of the categories
$K$4:$CG$502 is where I have the list of all the identifying text for each of the categories
C is the column in which the descriptions from the bank statements are
I have come up with the below formula, which works fine however if I expand it to the full range of identifiers (replace $K$4:$CG$4with $K$4:$CG$502 in SEARCH function) it fails.
={INDEX($K$3:$CG$3,1,MATCH(TRUE,ISNUMBER(SEARCH($K$4:$CG$4,C6)),0))}
Any help is much appreciated.
The table is found on this link. Column D is the expected outcome once the SEARCH function is expanded as in Column E, which currently arrives to N/A. "nnnnn" values in columns K to CG are dummy values and will be populated by users.
Using INDEX(), AGGREGATE() & COLUMN() Function, you may try this formula,
• Formula in cell D3
=INDEX($K$3:$CG$3,
AGGREGATE(15,6,(COLUMN(Control!$K$4:$CG$502)-COLUMN(Control!$K$4)+1)/
(ISNUMBER(SEARCH(Control!$K$4:$CG$502,C3))),1))
And Fill Down! Workbook_Link

How to filter through table using keywords and access that row of information

I have an excel sheet that lists all the engineering standard procedures (ESP) my company owns. I am trying to add another sheet to the Excel document to be used as a search bar so that when my colleagues and I type in a keyword that matches the description of the ESP (which is included in the original document) It lists the possible matches and includes the hyperlink for those esps (which is included in the original document), just in a different column then the description. Any help would be appreciated thank you!
I sort of have a solution for my problem, but it does not show any hyperlinks in the extraction table and I am limited to using one column for my data array, which is essentially my description column. So I have to manually re-enter all the esp #'s to that column.
I placed three different components in the new sheet that I added to the excel document. One component is just an two cells that are labeled search, where I could type in the key words I would like to search.
The second component is a count cell with the following formula :
=COUNTIF(Sheet1!A4:B95,"*"&B7&"*")
and the last is my extraction table with the following formula :
=IF(G5>B11,"",INDEX(Sheet1!B4:B95,AGGREGATE(15,6,(ROW(Sheet1!B4:B95)-ROW(Sheet1!$B$5)+2)/ISNUMBER(SEARCH(B7,Sheet1!B4:B95)),G5)))
I basically did what this tutorial told me to do link : https://exceljet.net/formula/extract-all-partial-matches
This works for me:
Formula in D2:
=IFERROR(INDEX($A$1:$A$7,AGGREGATE(15,3,IF(ISNUMBER(SEARCH($C$2,$A$2:$A$7)),ROW($A$2:$A$7),""),ROW(A1))),"")
Enter with Ctrl+Shift+Enter
Formula in E2:
=HYPERLINK(IFERROR(INDEX($B$1:$B$7,AGGREGATE(15,3,IF(ISNUMBER(SEARCH($C$2,$A$2:$A$7)),ROW($A$2:$A$7),""),ROW(A1))),""))
Again, enter with Ctrl+Shift+Enter
Drag both formula's down

New column in Excel to determine if given account number has one or both product types

I have a three-column data set in Excel: Column A is Account Number, Column B is Product Type, and Column C is Current Balance (see image below).
The table I'm using has +150,000 rows, the image above is for illustrative purpose to simplify what I'm looking at. Multiple rows may have the same Account Number, but a different Product Type and/or Current Balance.
I would like to create a new column for a unique identifier that would label an Account Number as having "All A's", "All B's", or "Both". What in Excel (formula, VBA, etc) can be used to achieve this?
You can create a helper column in Column A and use the following formula starting in A2
=IF(COUNTIF($B$2:$B$9,$B2)=COUNTIFS($B$2:$B$9,$B2,$C$2:$C$9,$C2),"All "&$C2&"'s","Both")
EDIT:
You can also take it one step further and only return the requested answer for the first occurrence of an Account Number by using the following formula (again by beginning in A2)
=IF(COUNTIF($B$2:$B2,$B2)>1,"",IF(COUNTIF($B$2:$B$9,$B2)=COUNTIFS($B$2:$B$9,$B2,$C$2:$C$9,$C2),"All "&$C2&"'s","Both"))
I believe this formula would work (tweak for your ranges):
=IF(AND(COUNTIFS($B$2:$B$9,"A",$A$2:$A$9,D2)>0,COUNTIFS($B$2:$B$9,"B",$A$2:$A$9,D2)),"Both",IF(COUNTIFS($B$2:$B$9,"A",$A$2:$A$9,D2)>0,"All A's","All B's"))
#Kris - Please try the below solution.
I have added a new column by concatenating Account Number and Product Type. Using this column, created an Identifier column with the formula below.
Identifier column formula:
IF(COUNTIF($A$2:$A$9,A2)=COUNTIF($D$2:$D$9,D2),"All"&B2,"Both")
Hope this helps.

excel, without script, just using its built in features, how to trigger a value or content in one cell based on value or content in other cell

Need advice on the following; Thanks in advance.:
Excel, the visual description of the issue
Further description of the issue:
certain Product code = certain Product name of certain Size.
The help-table on the attached image shows that a certain product code = what product name of what size, as a guide.
This is what I try to do. This is what my question is: How to achieve:
Manual entry in cells of column A should trigger automatically filled content in cells of columns B and C based on the content of A and based on the dependencies described in the help-Table.
Edited: As the user proceeds adding new records in new rows, the appropriate columns (B and C) should "fill itself" automatically as soon as there's an entry in the same row in column A. This automatically filled content in column C and B depends on what is the content of column A as can be seen on the attached image("help-table"). And all this should work without me using a formula in columns B and C.
So far I used an "IF" formula which is not practical for many possible product codes.
A formula is also impractical as its usage requires the formula to be copied to next row, which I want to avoid. I want the set rule to be applied to a whole column.(for example as the data validation or conditional formatting work in excel)
It would be ideal to use it in a way like the conditional formatting works, but in this case it should work with values(content) instead of colors and should be applicable for an entire column without a need of copying to the next row. That means I'd like to avoid macros or VBA if possible, just want to use built in features.
I already use Defined names and Data validation for columns A,B and C which works for me as a choice list and also to control column B and C for allowed entries only, so their content is not mistyped and has the strict format needed. Excel 2010 -if that matters.
Important: there will be 1000's of rows added, I just made a short description above
Formula for cells in column B:
=IF(A2=10,"prod1",IF(A2=20,"prod1",IF(A2=30,"prod2",IF(A2=40,"prod2",""))))
Formula for cells in column C:
=IF(A2=10,"50",IF(A2=20,"75",IF(A2=30,"10",IF(A2=40,"50",""))))
Also tried a CSE formula for the entire column B or C like follows (but the file size was couple of MB which is not desired):
=IF(A:A=10,"prod1",IF(A:A=20,"prod1",IF(A:A=30,"prod2",IF(A:A=40,"prod2",""))))
If the entry in column A will be only 10,20,30 and 40 then use OR formula in column B
=IF(OR(A2=10,A2=20),"prod1","prod2")
In Column C we can reduce two IF
=IF(A2=20,"75",IF(A2=30,"10","50"))
And regarding the file size please save it in binary format. Hope this will help :)

Why does this work? Exploring the VLOOKUP formula

I have an excel 2010 spreadsheet with 4 columns.
Column A: A list of UPC codes for products I sell. Around 300 lines.
Column B: Formula (more on this later)
Column C: Another list of UPC codes. These UPC codes are around 10,000 lines.
Column D: An inventory count which corresponds to UPC codes in Column C.
The formula:
=VLOOKUP(A2,C:D,2,FALSE)
The idea is to match up my UPC codes with my supplier's UPC codes to retrieve the corresponding inventory count.
All data was pasted into a new spreadsheet from other spreadsheets and were pasted as values only to ensure no other characters or formatting was imported.
This formula was dragged down for all 300 lines.
I received the error #N/A in Column B until I inserted the following character before the values in Column A:
'
Note: the ' was inserted manually by clicking on the cell and typing ' in the box above.
Immediately after this was done, the #N/A would change to the corresponding inventory retrieved from Column D.
My question is why does this work? Why does the method without the ' not work? Is there a way to quickly add the ' before all values in Column A? Note: CONCATENATE("'",A2) does not work for some reason.
raphael you've got it there - your number is stored as text in one of the lookup tables, and as a number in the other. Adding a ' to each line will fix it, but it's pretty horrible task. Clicking the green arrow can also fix it, but excels default method can be really slow for big tables (And it also changes your source data, which for me is a no-no, as when you update the data, you'll have to do it again). Changing the formatting rarely helps in this situation.
If the table contains numbers and lookup value is number-stored-as-text, you can multiply the lookup value by 1:
=VLOOKUP(A2*1,C:D,2,FALSE)
If the table contains "text" and lookup value is number, you can convert it to text like this:
=VLOOKUP(TEXT(A1,0),C:D,2,FALSE)
Here's my theory. In VLOOKUP, if the lookup value (A2) is smaller than the smallest value in the looked-up table (C:D) then it returns N/A. When you prepend the quote sign (') you make A2 a string, not a number. So for example a UPC of 1002 is no longer treated as the number one-thousand-and-two but as the string sequence one-zero-zero-two. That lets VLOOKUP do the comparison differently and avoid the N/A.
You might try Ctrl-1 in column A and get it to treat them all as text.

Resources