I want to extract only these words if present in a cell:
{Beijing, New York, Japan}
I have a column with the following data(rowwise):
Nice city- Beijing, Awesome climate
Fair city- Japan, Cool weather
New York is so nice
All i want is another column which will have:
Beijing
Japan
New York
Is it possible to do it without vba?
Is there any formula? I have nth entries rowwise
You can try:
=LOOKUP(2^15,SEARCH({"Beijing","New York","Japan"},A1,1),{"Beijing","New York","Japan"})
You could use a formula such as
=IF(IFERROR(FIND("Beijing",A1),0)=0,"","Beijing")&
IF(IFERROR(FIND("Japan",A1),0)=0,"","Japan")&
IF(IFERROR(FIND("New York",A1),0)=0,"","New York")
Related
I have list of UK postcodes. I want to find area and district value of postcode.
e.g. EN11 8HD from this address i want to find "EN" and "EN11'. I got the district value with the help of "text to column(by Space). but how to get area code from the postcode?
G12 8QH
SW1W 0NY
GU16 7HF
L1 8JQ
Need more explanation what actually want to do. Try below...
=IF(ISNUMBER(SEARCH("EN",A1)),LEFT(A1,SEARCH(" ",A1)-1),"")
Column A and B is a item and country post code. Column B contain two country post code USA and UK. Both country we have dispatched same part. I am trying to create vlookup formula corresponding to the range but its return na. Please help me.
Country code ranges;
USA Angeles10 Angeles20 Angeles30 Angeles40 Angeles50 Angeles60 Angeles70 Angeles80 Angeles90 Angeles100 Angeles110 Angeles120 Angeles130 Angeles140 Angeles150
UK London10 London20 London30 London40 London50 London60 London70 London80 London90 London100 London110 London120 London130 London140 London150
DATA
ITEM POST CODE
4 Angeles10
4 Angeles20
110489 Angeles30
110489 Angeles40
113388 Angeles50
113388 Angeles60
113636 Angeles70
113636 Angeles80
11363613001 Angeles90
11363613001 Angeles100
11363613002 Angeles110
11363613002 Angeles120
11363613003 Angeles130
11363613003 Angeles140
1136362001 Angeles150
4 London10
4 London20
110489 London30
110489 London40
113388 London50
113388 London60
113636 London70
113636 London80
11363613001 London90
11363613001 London100
11363613002 London110
11363613002 London120
11363613003 London130
11363613003 London140
1136362001 London150
DESIRED RESULT
ITEM USA UK
4 Los Angeles10 London10
I put the first data on a sheet named datasheet in starting in A1.
Then use a formula like so in the E3:
=INDEX($B:$B,AGGREGATE(15,6,ROW($B$2:$B$31)/((ISNUMBER(MATCH($B$2:$B$31,INDEX(datasheet!$1:$1048576,MATCH(E$2,datasheet!$A:$A,0),0),0)))*($A$2:$A$31=$D3)),1))
Then copy/drag over and down.
Easiset Answer
If your data isn't changing and you know exactly where Angeles stops and London starts, you can just use a standard VLOOKUP formula. You just give the bottom part of the table to the UK column.
E3: =VLOOKUP(D3,A$3:B$6,2,)
F3: =VLOOKUP(D3,A$7:B$10,2,)
A little more complicated
If you need to be able to add rows or locations, this solution will work better. Add helper columns for each of the locations you need and a helper column which combines the item ID with the location. You can then use VLOOKUP by searching for the combination of item ID and location.
B3: =A3&CONCAT(D3:E3) (can expand past E3 for extra locations)
D3: =IF(ISERR(SEARCH(D$2,$C3)),"",D$2)
E3: =IF(ISERR(SEARCH(E$2,$C3)),"",E$2) (can drag right for each extra location)
H3: =VLOOKUP($G3&H$2,$B$3:$C$10,2,)
I3: =VLOOKUP($G3&I$2,$B$3:$C$10,2,) (can drag right for each extra location)
My favorite Answer
Just use Scott Craner's approach! ☺
Trying to make this scenario work -
Have to reference a range of cells in a column in another work sheet and if the values are like new york 4th street it must populate as new york or must populate the default value.
=(IF(Dashboard!GT14=New York - C4) , New York , Dashboard!GT14) - this does not work
couple of other scenarios also do not work
Suggessions welcome
First, New York should be "New York".
And what is C4 ?
For example, if C4 is "Boston" and you want to know if GT14 is "New York Boston", you have to put GT14 = CONCAT("New York ";C4)
Something like this?
=IF(ISNUMBER(FIND("new york",LOWER(Dashboard!GT14))),"New York",Dashboard!GT14)
assuming you have a full address in GT14 and that you want to check if New York is part of that.
If possible, I need help with creating excel macro which will clean some fields in my spreadsheets.
I am receiving excel spreadsheets with different amount of records. And in the following spreadsheets I need to format fields like First Name / Last Name / Job Title / City (I used excel Proper() function when I did it manually). Most important, I need also to replace Industry field with the standard values from another sheet. And: to replace State (from short values, like TX to Texas), also replace Country from us or usa or united states of america to "United States". (when I performed this manually, I used VlookUp () function).
Example:
I have spreadsheet(s), like:
Sheet 1, Data:
FName LName Email Title City ST Phone Industry Country
John sm j#hotmail.com it dallas TX 5556663344 mobile us
jess lee jess#aol.com ba ny ny 6667775656 art usa
nick Jahn nick#aol.com ba raleigh ny 444-3338888 tech us
Sheet2, State:
ST ST_Full
TX Texas
NY New York
NC North Carolina
etc. -> all US / Canada states list
Sheet 3, Industry:
Industry Industry_Correct
Mobile Telecom
Art Other
Tech Technology
etc. -> the list of all possible variations correct/incorrect industries
Sheet 4, Country:
Country
Angola
Canada
Russian Federation
United States
for the Sheet 4, I have alphabetical list of over 200 countries, and need to replace countries like "us" "Russia" to proper name from the list.
Result Sheet, (what expecting to have):
FName LName Title City ST Phone Industry Country
John Sm It Dallas Texas 555-666-3344 Telecom United States
Jess Lee Ba New York New York 666-777-5656 Other United States
Nick Jahn Ba Raleigh New York 444-333-8888 Technology United
States
email
j#hotmail.com
jess#aol.com
nick#aol.com
I was trying to record very simple macro; but I have very different spreadsheets - w. different amount of records - from 5 to 2000 or 3000 records.
Simple recorded macro only somehow cleaned FIXED amount of records.
It sounds like you have your recorded macro working properly except that it is working on a fixed amount of records. You need to make the range dynamic so your macro can see how many rows of data there are automatically. Without seeing your code, its hard to tell you how to implement this. Generally, something like this will do the trick:
Dim sht As Worksheet
Dim LastRow As Long
Set sht = ThisWorkbook.Worksheets("[sheet name]")
'Can also reference the sheet code, which is better in my opinion. Set sht = Sheet1 or whatever number your sheet is.
'This will fetch the last row for you
LastRow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
You may find this website helpful: http://www.thespreadsheetguru.com/blog/2014/7/7/5-different-ways-to-find-the-last-row-or-last-column-using-vba
To respond to your comments:
You should implement this at the very beginning of your code. So what we are doing is 1) setting the sheet for the macro, 2) determining the last row of data in that sheet, and 3) you need to then use that last row to set a Range for the macro to work on, or at least go through your macro and replace row 1000 with LastRow. So, in addition to the code I provided, you may also have something like:
Dim myRange as Range: Set myRange = sht.Range("A2:Z" & LastRow)
Then you can simply reference myRange when you need your macro to do something in that range. Hope that helps. Instead of make a new post, you should be able to edit your original post to add some of your code if necessary.
As to your IFERROR question, its hard to say the most correct approach without more information. Generally speaking, I think its better to use if/else statements, but you can certainly just use WorksheetFunction.iferror(...) if you need to replicate the same iferror functionality that is built into Excel.
I am trying to merge the data from three columns into one column in Excel. Example, i would like to merge Product, Location, and Key_id into one column
Product Location Key_Id
Car VA 86421910
Car VA 86424482
Car VA 86416836
Combined Column:
Car 'VA', '86421910'
Car 'VA', '86424482'
Car 'VA', '86416836'
I was wondering if there is a way in Excel that can do it? Thanks in advance! I was not doing a good job of accepting the answers in the past. I will do my part which is to accept the answer moving foward.
Regards,
http://www.info-stat.com/XLConCat.htm shows examples of string concatenation in Excel. If I knew which version you were using and could identify the column IDs I could write it.
Assuming Product is Column A, Location is Column B and Key_ID is column three and data starts at row 2:
=A2&" '"&B2&"', '"&C2&"'"
=CONCATENATE(A2," '",B2,"', '",C2,"'")