If Statement Limit Workarounds: Convert Various Codes From One Column Of Spreadsheet Into Different Codes In Another Column

May 5, 2006

I'm trying to convert various codes from one column of an excel spreadsheet into different codes in another column. I was able to accomplish this with "If" statements, however I'm only able to string together seven of these statements in one command. Is there a better way to add formulas for more than seven conversions? Below is a copy of what I've done so far with the seven converts:

=IF(ISNUMBER(SEARCH("WARN",J2)),"Warning",IF(ISNUMBER(SEARCH("PSSNAP",N2)),"Sales",IF(ISNUMBER(SEARCH("WARN",L2)),"Warning",IF(ISNUMBER(SEARCH("2699",L2)),"Warning",IF(ISNUMBER(SEARCH("4004",L2)),"Warning",IF(ISNUMBER(SEARCH("2036",L2)),"Warning",""))))))

I want to add about 15 more codes to convert within this formula but it's maxed out in the format I'm using.

View 3 Replies


ADVERTISEMENT

Zip Codes To Be Pushed To The Next Column

Jan 12, 2009

City, state 29785
city, state 29767
city, state 29719

I need the zip codes to be pushed to the next column, to column 'D' to be exact. I already tried using the "text to columns" function. I selected "delimited" file type and used "2". it pushed the data to the next column everytime there was a 2. The problem is, there are 2's in the middle of the zip code sometimes. Also, it gets rid of all the 2's. Also, I can't use the "fixed width" option because there are some city/states that have more letters in them obviously, so the column is not a perfect width.

View 8 Replies View Related

Sum Of A Column Based On Different Account Codes

Jan 3, 2014

I am trying to find the revenue generated by different groups of accounts to figure out which group is worth the most, and rank the others.Here is a attached screenshot of what I am working with, cell BK22 is the revenue of all of the accounts coded AADA but i need to find an easier way other than plugging it in for all 3500 cells.

View 6 Replies View Related

Find Numeric Codes In A Column And Replace In Vba

Oct 18, 2007

I am using the following vba code to find numeric codes in a column and replace them with the same code along with descriptive text:

Range("Q:Q").Select
Selection.Replace What:="11", Replacement:="11 - GSA"
Selection.Replace What:="10", Replacement:="10 - NYS OGS"
Selection.Replace What:="1", Replacement:=" 1 - Dist Sale"
Selection.Replace What:="2", Replacement:=" 2 - Direct Sale"
Selection.Replace What:="3", Replacement:=" 3 - No Sale: Warranty Exchange"
The problem as you might already see is that when the replacement of "1" happens, Excel will replace the 1 in the 10 and 11. Of course I want to only replace the number 1. Is there a better way to code this operation?

View 9 Replies View Related

Find The Part Codes Having Some Indication And Arrange Them In A New Column

Feb 19, 2010

My question is how many parts havinig end with C?Also arrange these parts in ascending order in a new column. Refer to the attached file and expected result also.

View 5 Replies View Related

Adding Column With Description Based On Preset Codes

Jul 13, 2006

First it should Insert a Column to the left of A. Then it should go to column B and search for the number 99 and delete all rows after it. In column C I want it to do the following formula =vlookup(b2,descriptions!$b$2:$c$250,2,false) and have it copied all the way down to the end of data.

Next I need labels added to the tops of the rows
Next I need the description columns in C to be copied to column I
Finally, beginning at J2, I would like the formula (e2 * g2)/100 entered to the end of data. Attached is sample data.

View 2 Replies View Related

Nested IF Statement To Recognize Root 'codes'

Jul 6, 2009

if the code is 110 add together all amounts attached to that code and sum them in a new cell. Perfect. Now however there is an added level of complexity and i need to figure out how to nest an IF statement into a =sumif() function so that code amounts are summed into their root code, for example the root code of 110, 120, 130 is 100.

So basically i want a function that will sum the specific code (110) and then sum together that amount under the root code (100). Here is an example. The amounts for the lower level codes have been summed but i need the high level codes to be summed together.

View 4 Replies View Related

Convert Zip Codes To Latitude And Longitude

Jul 15, 2014

I currently have an excel file of around 40.000 records with their zip/postal codes accompanying addresses in countries all over Europe, I would like to convert these into latitude and longitude coordinates.

View 2 Replies View Related

Function Convert Codes Automatically

Mar 22, 2006

I have entered a lot of functions mainly VLOOKUPs. I want to write VBA codes for the functions without manually writing them. Is there a way in which I could get the manually written functions converted to codes automatically?

View 9 Replies View Related

Using VBA Codes To Generate Consecutive Numbers And Convert Them Into String

Jan 10, 2013

If n = 5, then I want to generate a string like this: "1+2+3+4+5". Similarly, if n = 7, I want the string "1+2+3+4+5+6+7".

I can generate the consecutive numbers, but have not figured out how to generate the required string.

View 5 Replies View Related

Add ‘country Name’ Column To Worksheet From A List Of Country Codes.

Apr 2, 2009

I've got a worksheet with five columns of data. One of the columns contains country codes. I have a list of countries that the codes relate to. I would like a new column in the worksheet that contains the country name. I'm not sure if this is possible, but it seem that most things are with VBA! The countries and their codes are on 'Sheet2' I relalise I might have to do some boring re-ordering of the data on 'Sheet2'

View 2 Replies View Related

Convert Column Headings To Cell Value In Large Spreadsheet

Mar 12, 2014

I have a very large spreadsheet that is a consolidation of approximately 105 separate of contacts lists. The new consolidated spreadsheet contains demographic data, and a column for the name of each of the 105 lists. Each contact in the consolidated list had an "X" placed in the column if they were a member of that particular list. Each contact can be in more than one list. This is not very useful for me.

Here's a visual representation of the current list along with what I need:

FName
LName
Address
Phone
City
List1
List2
List3
List4
List5
List6

[Code] .....

I would like to add a column to the spreadsheet and call it "Source"

And then have a macro or VB script to do the following:

1. As shown above, put the column name (ie "List2") in the "Source" column whenever there is an "X" in that row for the corresponding Column.
2. Because each contact can be in more than one list, I need to append the column names so that "Source" column contains all of the column names (Lists) that had an "X"
3. Once all of the list names have been added to the "Source" column, I will delete the list columns.

View 1 Replies View Related

Distance Between Zip Codes

Feb 26, 2009

I have two columns, zipA and zipB. There are over 7000 rows and I need to calculate the distance between zipA and zipB for each row (so the result should be over 7000 rows of distances (in miles)). I posted this in the programming board because I figured it would require some. I don't have any add-ons.

View 14 Replies View Related

Combining 2 Codes Into 1

Jun 9, 2013

Just starting to learn VBA. I have the 2 following codes.Can they be combined into 1 code.I have 2 buttons one say hide rows and the other button says unhide rows....can 1 button be used and when the rows are visible the button says hide rows and when the rows are hidden the button says unhide rows

Sub hiderows()
ThisWorkbook.Sheets("sheet1").Rows("3:12").Hidden = True
End Sub
Sub unhiderows()
ThisWorkbook.Sheets("sheet1").Rows("3:12").Hidden = False
End Sub

View 6 Replies View Related

Distance Between 2 Zip Codes

Feb 24, 2007

At my last job we purchased a zip code addin from spheresoft that could give you a distance between two distance ie: =ZipCodeDistance(zip1, zip2)

This worked well but I am now at a new job and wondering if there is any data out there that could help me build my own sheet. I just need California

I have both zip codes now just need the distance, I could sit down, drink a ton of coffee and enter zip codes all night into Mapquest but am hoping for a better way.

View 9 Replies View Related

Borders Around The Codes

Mar 22, 2007

I have a spreadsheet containing data in coloumns A to L.

Where all the codes in column B are the same then a border must be placed around all the codes that are the same i.e the border must start in Column A and end with column L.

provide me with the code the will put borders around the codes in column B that are the same ...

View 9 Replies View Related

How To Share Codes

Apr 1, 2008

I have written a VBA code.

I thought I could just save it as an ADD-IN and then have my colleagues to add it, but that does not work. The macro will be stored in a seperate workbook and that is not what I want. I want them to be able to open any workbook and want them to be able to run the macro. I.e. everytime they open a workbook the macro should be available and be ready to run.

View 9 Replies View Related

VLOOKUP With Zip Codes

Feb 10, 2009

VLOOKUP returns incorrect results when comparing zip codes across worksheets. I think the problem could be caused by 2 things:

1. There are duplicate rows in the lookup_value range because each represents an individual and needs to remain a duplicate to show whether there are multiple individuals from the same zip. In these cases, VLOOKUP only returns the first matching zip from rows containing duplicate zips. (See 07042 in worksheet 1 of the file linked below.)

2. Zip code format is not being treated as a number during sort. Do I need to use a different format during sort? Don't want to lose the leading zeros on the zips.

View 9 Replies View Related

Combine PDF Using VB Codes

May 28, 2009

I am looking out for a macro by which i can combine multiple PDF's into one through excel using vba codes.

Please note that:
> all these PDF's are in one folder
> the code needs to be dynamic (i can have an option to combine selected PDF's
> i am working in excel 2007
> i have acrobat 8.0 installed

View 9 Replies View Related

Need 2 VBA Codes For Names

Oct 2, 2009

I have names in the following format in Column A: e.g.

Mr. Doe SmithSmith DoeJr. Doe SmithJr. Smith DoeMiss Abc XyzMrs Abc XyzXyz Abc


I want a VBA code that would turn all different formats of names listed above as:

Doe Smith

Abc Xyz


I also want another code that would turn above formats as follows: (by the last name)

View 16 Replies View Related

Data To Shift On Column 2 After Reaching The Row Limit Of 65,536 In Column 1

Apr 12, 2007

i am using the code posted by Reafidy on [html] http://www.ozgrid.com/forum/showthread.php?t=62708[/html] to create a list of all possible combinations. The only problem i have is that sometimes the total no. of combinations exceed the excel row limit of approx 65,536. once the row limit in column 1 exceeds 65k, the remaining combinations automatically shift on column 2 and then on 3 n so on.

View 6 Replies View Related

Convert Column B As Multiple Column Titles And Move Data In Column C Into New Columns?

Jun 30, 2014

I have a excelsheet that looks like this:

Column A | Column B | Column C
Los Angeles | Fire Dept | 3
Los Angeles | Health Services | 12
New York | Fire Dept | 8
New York | Health Services | 22
New York | Internal Services | 100
New York | Public Works | 7
Chicago | Health Services | 15
Chicago | Public Works | 56
Chicago | Social Services | 4

And I am trying to make it look like this:

Fire Dept
Health Services
Internal Services
Public Works
Social Services

Los Angeles
3
12

New York
8
22
100
7

Chicago

15

56
4

View 8 Replies View Related

Calculate Unique Codes

Oct 23, 2009

I have a database where each subject has data for 4 days and a number of different codes each day. I am looking to calculate how many different codes they have on day one, how many unique codes they have on each subsequent day and the sum of all these codes.

For example, in the data attached:

Subject 10002 = 2,1,0,0 (3)
Subject 10005 = 3,1,0,0 (4)
Subject 10009 = 3,1,1,0 (5)

View 12 Replies View Related

Macro To Lookup Many Codes

Nov 17, 2008

I have an excel workbook with two worksheets. The first worksheet contains a lot of data with more than 20.000 rows and 20 columns. The important part is that there are two different columns (column F and I) containing codes of items. What I would like the macro to do is the following:

write codes of items in the second worksheet column B under each other. I would like the macro to lookup the codes from this column in the first worksheet (column F and I) and if it finds then display in worksheet 2 column C the column in which found it on worksheet1. So basically I write on worksheet2 column B many many codes and then I press a button to do a search and displays next to the items (in column C) if it found the code in worksheet1 column F, or column I or both, or did not found it.

View 2 Replies View Related

Merge Similar Codes Into One

Jun 8, 2009

I have the following seven codes used to fill a ListBox with data retrieved form a range (DACNRange).. they are almost the same .. the only difference between them is the range column number (highlighted with red). Instead of these seven similar codes, Can we create a general code replaces them all?

View 2 Replies View Related

Delete Or Hide All VBA Codes

Dec 30, 2012

I am just thinking if there is a way to delete or hide all vba codes as I dont want readers to see them.

View 4 Replies View Related

Finding Zip Codes Within A Zone?

Apr 18, 2013

I have a spreadsheet that has Zip Codes by Service Days, and then I have another Spreadsheet Zip Code Ranges and the Zone they fall in. I want find the Zip Code associated within that Zone for the Zip Code. I listed some data below.

Zip Code Spreadsheet

State Destination Zip Service Days
NY 12095 2

Zone Chart

From Zip
To Zip
Zones

[Code].....

View 5 Replies View Related

How To Merge Two Codes To Allow (2) Functionalists

Jan 3, 2014

How to merge two codes too allow (2) functionalist

I have a rather complex situation that I'm not sure how to handle. First let me provide some background on what I have accomplished thus far.

Background: I have an excel file with two worksheets. Worksheet two, named Data, is where all my data is located. It begins with A1 going through JC4 (A1:JC4). However, for the purpose of my project the data I'm concerned with starts on E1 through JC4. Also, every other column is formatted with ="".

I have used the following sequence of commands, obtained from a website, to make it much simpler to define name ranges:

Select the worksheet "Data"Select cell A1Select the current region using CTRL + SHIFT + 8Press CTRL + G to bring up the Go To dialog boxClick on the "Special" button to bring up the Go To Special dialog boxSelect "Constants" and press the ENTER key (or click the "OK" button)Now define the Named Ranges using your selection by pressing CTRL + SHIFT + F3Excel will ask you to "Create names from values in the:" Make sure only "Top row" is selected, then press the ENTER key (or click the "OK" button)Check that the correct named ranges have been defined by opening the Name Manager with CTRL + F3 While I have defined named ranges with the above steps, this is not the same as a dynamic named range. At least I don't think its the same thing.

I have also protected the worksheet to prevent anyone from changing the formatting. Note: the top row of each column that contains information has been designated as the name for the information that comes after it (see step 8 and 9 above). Now, my first worksheet is where I have created conditional drop down screen by using data validation. The drop down screen are conditionally formatted. Meaning depending on the selection from the drop down screen in cell E27 will determine the list on the drop down screen in cell F27, and so on through cell H27. Furthermore, the drop down items on:

1) Cell E27 (in the first worksheet) are located on the second worksheet in cells E1, G1, I1, K1. Each of those columns have a list of items that fall under them.

The lay out of the data worksheet is too combursome to list out, but I have attached a picture. IF you follow the data you will see some of the information is listed in two cells, for conditional formatting purposes. I have also attached a picture of worksheet 1 with the drop down screens.

Code 1: (allows the selection of multiple items in one cell separated by a comma)

Developed by Contextures Inc.
' www.contextures.com
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
Dim lUsed As Long

[code]....

Code 2: (allows for manually adding directly to the drop down list a new item that is not on the list. It will then add it to the list after the hard entry directly to the drop down menu). Remember the list will be on the Data worksheet, worksheet #2. The drop down menus are on the first worksheet).

' Developed by Contextures Inc.
' www.contextures.com
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim ws As Worksheet
Dim i As Integer
Set ws = Worksheets("Lists")

[code]....

I have added the first code by right clicking on the worksheet and viewing the code, then adding Code 1. It works beautifully.

What I'm trying to figure out is how to add Code 2 to the mix with out unding Code 1. I'm trying to either combine the codes or insert the second code without disrupting Code 1. Remember I have already created a defined name range in my Data worksheet for all my columns/information. I tried deleting Code 1 and only inserting Code 2 but it didnt work. Code 2 does not work based on how I have designed the formatting. How do I apply Code 2 to what I have done thus far? Can this be done by bypassing a dynamic name range, since I have already assigned a defined name range? I want both codes to apply to Columns E, F, G, and H on the first worksheet.

View 1 Replies View Related

Filter UK Post Codes

Feb 7, 2007

I have a list of UK Post Codes that I wish to filter but because of the format I'm getting problems.

The reason is that I'm only interested in the first part of the post code.

Example: Using IP7 6NH and IP32 8LR. If I tried to filter those using greater than then Excel would treat IP7 6NH as larger then IP32 8LR because 7 is larger then 3.

The post codes are all imported from another piece of software and are always in the format of 3 or 4 chracters, then a space and then 3 more chracters. I wish to create another column which only has the first part in it. So I wish to crop IP7 6NH down to just IP7 and IP32 8LR down to just IP32.

Then I want to make a further column which looks at the value in the first new column and returns "In" or "Out" based on some conditions.

These are the conditions. If the cell begins with CO or NR or CB or CM or PE, regardless of the rest of the value, then "Out" should be returned. If the value is between IP1 and IP6 inclusive then "Yes" should be returned.

If the value equals IP7 then "No" should be returned

If the value is between IP8 and IP17 inclusive then "Yes should be returned.

If the value is between IP18 and IP29 then "No" should be returned.

If the value equals IP30 then "Yes" should be returned.

If the value is bewteen IP31 and IP33 inclusive then "No should be returned"

I'm think that it's quite complex and maybe the way to go would be to have two other columns, one containing the "In" values and the other containing the "Out" values, that a formula can refer to when making it's yes or no choice but I don't know how to do that.

View 9 Replies View Related

Codes To Display A Msg Box Upon Delete

Feb 27, 2007

I need a macro that displays a msg box when the user hit Delete on the keyboard. "The msg box will display/

"Are you sure you want to delete the selected information? This information might not be recovered.

If you delete it now the undo button in the toolbar could recover the information if activated prior to any other input.”

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved