Complex Printing Of Values Of Unique Strings Between 2 Arrays?

Jul 11, 2014

I have the following arrays.

A1=Array("A","D","F")
A2 = Array(Array(0, 1, 4, 5), Array(2, 0, 1, 1), Array(2, 3, 11, 3))

B1=Array("D","X","F","J")
B2 = Array(Array(6, 0, 2, 1), Array(1, 1, 6, 1), Array(7, 9, 1, 0),Array(0, 3, 2, 2))

I would like to print in column A all the unique/common values between Array A1 and Array B1. The common values are A,D,F,X,J. And I'd like to print in Columns D:G the A2(i) values and print in columns I:L the values B2(i) in the corresponding row of values of arrays A1 and B1. If some string only appears in array A1 (i.e. "A"), this means that string "A" have values associated in array A2, but not in B2, then print zeros from I:L and if the string only appears in array B1 (i.e. "X" and "J"), this means that strings "X" and "J" have values associated in array B2, but don't have valus in A2, then print zeros from D:G for the same row of X and J.

View 7 Replies


ADVERTISEMENT

Complex VBA / Formula To Multiply Values

Aug 9, 2012

I have a complex request which I think can be done either via vb or a macro, not sure which is best?, will try to explain:

The table shows a list of items that make up various BOM. there are quantities of each item required at the different BOM level

0 = Top level
1 = Level Below
2 = Level below that etc, etc

If the top level (0) has a quantity greater than 1 then all the items at the lower levels should be multiplied by that quantity

THEN move to the level 1's and whatever the quntity is in the level 1 field, multiple all lower levels by that number
if the quantity fields are blank, then always multipy below by 1

This needs to continue on down the chain of levels

So basically you end up with the correct quantites of each item at each BOM level.

View 9 Replies View Related

Count Unique Strings In Excel Column

Apr 3, 2012

I have a long list of products in an Excel column. I want to count the number of unique items in the list (the cells contain strings, not values).

I know I can use the "Remove Duplicates" tool in the Data menu, and then use a Count function on the resulting list. I wondered if there was an Excel function or formula that would do it, similar to the Frequency function that does the same thing with a list of values.

View 3 Replies View Related

Return Row Number Of Complex Matrix Values?

Oct 30, 2013

In the attached sample file, one can see the setup of my data. I'm trying to reference the row number of a certain cell in a matrix with many cells of the same value. I have different Headers of each row, which should make it possible to use INDEX, MATCH or VLOOKUP. but i don't seem to be able to get it right.

Description.I need to return the "class" och each of the capability elements, i.e. If the capability in "Soups" is marked ("X"), at class 3, i need the integer "3" to be shown here.

View 12 Replies View Related

Complex Logic Formula To Delete Values

Nov 14, 2009

upon further consideration I thought that it would be best to probably do verything in two passes or maybe not see below macro to get an idea of how the end process should function

View 4 Replies View Related

Counting The Number Of Unique Text Strings In A Column

Oct 3, 2007

I have a list of around 50000 names. I need to count how many are unique.

View 9 Replies View Related

Slicing And Dicing CSV Files - Involves Arrays And Jagged Arrays

May 8, 2013

I am retrieving a CSV file from the net. In this file there are 'x' amount of row data and 7 columns. I only care about the values in the 7th column for each row. I also don't care about the entire first row. A graphical version would be represented something like this, with the values I want colored in orange:

|---,---,---,---,---,---,---|
|---,---,---,---,---,---,---|
|---,---,---,---,---,---,---|
|---,---,---,---,---,---,---|
|---,---,---,---,---,---,---|
|---,---,---,---,---,---,---|
|---,---,---,---,---,---,---|

.
. extending until the end of the data set
.

I've managed to dice this thing into a jagged array by first splitting it using vbLf as a delimiter, and therefore adding those to an array called Lines(). Then I split Lines() up using commas as the delimiter and threw those into a jagged array, let's call it Breadcrumbs()(). I want to throw all the values from Breadcrumbs(i)(6) into an array of its own. Here's my code so far:

Code:
Public Sub CSVparser(file As String)
Dim Lines As Variant
Dim j As Integer
Lines = Split(file, vbLf)
ReDim breadCrumbs(UBound(Lines)) As Variant
For i = 1 to UBound(Lines) - 1
breadCrumbs(i) = Split(Lines(i), ",")
Next i
End Sub

View 1 Replies View Related

Count When Values Occur In Different Arrays

Feb 26, 2009

My difficulty is this. I have 2 columns, A and B. A contains only 0's and 1's. B contains any number from 1 to 100. I want to count all the instances of any given number in Col B that are matched with a 1 in the corresponding cell in Col A.

View 6 Replies View Related

Count All Unique Values (text) + Definition Of UNIQUE :D

Aug 24, 2009

If I have multiple entries with different but repeatable text values in one column - how do I count all unique ones ? Is there a function or does it have to be a pivot table of sth ?

View 14 Replies View Related

Assigning/Retrieving Arrays Of Values To/from Listobjects

Jul 7, 2009

How can I add an array of values to a listobject, preferably in one big chunk? How can I read a chunk of values from a listobject into an array?

For the latter, I've tried:

View 2 Replies View Related

Add Values To 2 Arrays Depending On What Is In Worksheet Table

Jan 4, 2012

I have some arrays to loop through some code which generates some graphs:

Code:
Sub demo()
Dim aServer
Dim aType
Dim i
aServer = Array("a", "b", "c")
aType = Array("1", "2", "3")

[code]....

I am now trying to populate the arrays dynamically and thought I could work that out myself, but this is my first ever time with VBA and it's not as easy as I thought (Or maybe I'm not as clever as I thought!)

I have a table in a worksheet with column headings and row headings which are the values to be added to the array.

Lets say I have the following:

Column headings = "x", "y", "z" (these are the potential aType values)
Row headings= "1", "2", "3" (these are the potential aServer values)
_,x, y, z
1
2
3

The values in the table are either TRUE or FALSE (Or blank which should be interpreted as FALSE). Where there is a TRUE the column heading should be added to the aServer array and the Row heading should be added to the aType array.

In this 9 cell example (Not counting the row and column headings), if the first 2 rows had all the values as TRUE (See example table below) it would therefore result in the following arrays:

_,x, y, z
1,TRUE,TRUE,TRUE
2,TRUE,TRUE,TRUE
3,FALSE,FALSE,FALSE

Code:

aServer = Array("1", "1", "1", "2", "2", "2")
aType = Array("x", "y", "z", "x", "y", "z")

If the table was as follows:

_,x, y, z
1,TRUE,FALSE,FALSE
2,FALSE,FALSE,FALSE
3,FALSE,TRUE,TRUE

It should result in the following arrays:

Code:
aServer = Array("1", "3", "3")
aType = Array("x", "y", "z")

this would work out how many rows and columns there were based on how many column headings and row headings there were (So I wouldn't have to change the hardcoded VBA when the table grows, therefore making it easier to share the spreadsheet with others)

View 3 Replies View Related

Search Arrays For Specific Values And Copy "associated" Values To A New Location

May 26, 2006

Given the following data located in Sheet1 of a Workbook -

•I have seven columns (assume header row names are “A, B, C, D, E, F, G”) each containing numeric data in random order.
•All columns are of the same length (equal number of rows), followed by a blank cell, but the number of rows is unknown.
•Columns with header row names A-E will only contain numbers from 0 to 100, while F and G may contain numbers from -127 to +128.

Here is what I would like to do –

I would like to be able to analyze the data in columns A-D to locate rows that contain specific combinations of values (ex. row 41 contains the values 50, 0, 0, 0 and row 239 contains values 100, 0, 0, 0 in columns A – D, respectively, etc.).

For each row that is found to contain one of these combinations (there are many different combinations required), I would like to copy the associated values from columns E, F, & G for that row, and paste them into their respective (E, F, & G) columns located on Sheet2 of the same workbook. However, I would like to paste the E, F, & G values into a specific row order on Sheet2, DETERMINED by the value of the A – D combination identified on Sheet1.

Continuing with the ex. above, let’s say I would like to have the EFG values from row 239 in Sheet1 copied to row 10 in Sheet2, while the EFG values from row 41, Sheet1, are to be copied to row 11 in Sheet2.

In effect, I would like to create a table of this subset of data, in a specific order, from which I could work later.

I can do this manually using “ AutoFilter” to locate the data I need and then write formulas to copy the data from Sheet1 to Sheet2 in the order that I need, but every time the order of the original data on Sheet1 changes I have to start all over.

View 9 Replies View Related

Excel VBA Plotting Of Bar And Line Graphs Given Arrays Of X And Y Values

Jul 14, 2014

Plotting of bar and line graphs given an arrays of x and y values in VBA? I want to plot the rDateRange and rOEERange.

Code:
Dim rInitialDate As Range, rFinalDate As Range, rDateRange As Range, Calculation As Worksheet

With Worksheets("Calculation")
Set rInitialDate = .UsedRange.Find(What:=DateValue(InitialDate), After:=.Cells(1, 4), LookIn:=xlFormulas, LookAt:=xlWhole, SearchDirection:=xlNext, SearchFormat:=False)

[Code] .........

View 2 Replies View Related

Excel 2007 :: SUM Numbers Within Cell Based On Unique Strings In Another Cell?

Jan 11, 2012

how would you do the following in excel 2007:

"SUM numbers within a cell based on unique strings in another cell".

For example, how would i use formula to SUM the following numbers (and only the numbers for david and sam only once), 700+454+50+40+2+129+16

700david
700 david
454john
50buch
40daniel
2sam
2sam
129mike
16steve

View 9 Replies View Related

Rank Strings And Values?

Feb 22, 2014

Using formula, how do I rank

CAM100-24
COM98-21
CAM100-18
CAM27-37
COM121-5
COM98-23

so it first sorts in alphabetical order using the string before the "-" i.e. CAM27 comes before CAM100, and then by the biggest 'secondary values' (the value after the "-") so that COM98-23 comes before COM98-21?

View 2 Replies View Related

Sum Values From Alphanumeric Strings

Feb 8, 2007

On a work sheet I have 20 columns that may or may not have data in it. In the 21 column I want to have a sum "of the values" in the other columns. Problem is the data is in this form i.e. 6 01/17/07 smr or 15 1/19/07 gtw or 24 01/21/07.

To clarify each cell will have a value of a number from 1 to 99 followed by 2 spaces. Then it can have 2 more spaces and an id tag or just finish with the date.

So, from the example above in column 21 I would have a current value of 45 and it could change if more values were added.

Note values are generated from a macro. It may be possible to change the macro so that a comma or such may be used to seperate the different "values / data types"

View 4 Replies View Related

Lookup Multiple Values And Strings?

Feb 21, 2014

I have a huge document that looks like this. This is only one part of roughly 2500 lines
blank
Original Budget
Previous Estimate
Estimate Actual
Actual Costs

[Code].....

My problem is that I need to extract Soft committ and actual cost for each element (this case its TPS658). What really makes the problem for me is that I only want cost for cost place 230, 250, 300, 350 (only 350 shown here). Not the total that is shown in the row for element name.

View 4 Replies View Related

Look For Identical Strings And Add Cell Values Beside Each

Feb 18, 2009

Hi guys, I am looking for a macro to do the following:

Go down a column and identify all accounts that are identical, then add up the values that are 5 columns to the right of each account and paste them on another sheet along with the account code (there are 12 values for each account to be added with the other identical accounts).

I've attached a spreadsheet, because I understnad this might be kind of confusing. In essence:

1. Go down column C

2. Look for accounts that are identical

3. Add up the values for each account in columns G:R

4. Copy and paste the added values to another sheet along with columns C:F for each account to identify it.

View 9 Replies View Related

Check The Different Values In Each Row Where This Strings Occure

Nov 15, 2007

I have strings like this:

"xx-xx-100-ap01"
"xx-xx-200"
"xx-xx-200-ap01"
"xx-xx-200-ap02"
etc

I'm running a loop on all cells, and checking different values in each row where this strings occure.

But I would like to do a IF check on this string. If it find a string with 'ap' in it, it should do my check.

My problem is to understand the combinations of right, len, mid, instr etc. How could I use this functions to do checks in the strings.

View 2 Replies View Related

Chart Text Strings & Sum Up Values

May 5, 2008

I came upon this link below about a week ago: Create Chart/Graph From Text Strings
Domenic provied a solution that it will graph text strings in column A and it will display in the pie chart by using Define name range formulas. My dilema is I would like a second condition in those formulas. I would like the formula look in column A and sum up the values in column B base in column A and display it in the pie chart.

View 2 Replies View Related

Finding Partial Strings From Array Of Values?

Aug 16, 2013

I have a table with three columns, column 1 is a list of names, column 2 is where I want my result to appear, and column 3 has my array of search values. Column 1 and 2 could have any number of rows with values, but column 3 will have less values. It looks like this if it's working right:

Item List
Result
Search List

[Code].....

What I am trying to do is for each cell in column 1, I want to see if there is a matching value in column 3 - it has to be either an exact match or a partial match (i.e. the string appears somewhere in the values of column 1).

I have been trying to use MATCH like this:

=ISNUMBER(MATCH($A2,$C:$C,0))

but it does not return true unless the match is exact.

way to get these partial string matches to work?

View 3 Replies View Related

Finding Strings In VLookup Value - Embedded In Larger Strings Within Table Array

Dec 20, 2012

I need to do a vlookup that takes a string from one cell and then tries to find that string (embedded in a larger string) in the table array

Essentially I imagine this involves the FIND function at some point.

Attached is an incredibly simplified example of what I'm looking for.

View 9 Replies View Related

Removing Cell Values When Printing

Dec 20, 2006

I am working on a form right now for a shipping company in MS Excel. Anyways, I have a few cells formatted as text that have a starting value of "[Insert Comments Here]". What I am trying to do is have it so that IF the cell has the original value "[Insert Comments Here]" upon printing, THEN the cell's value is changed to "" or some other way of not making it print.

I would like to be able to do this both with cells and the "Label" form objects.

View 9 Replies View Related

How To Use VBA To Search Strings And Return Values Or Cells Nearby

May 20, 2009

Im needing to search through the attached document which is truck logs at a mine and use vba to search through the list for each of the different shovels eg SHVL1, SHVL2 & SHVL3, and when the code finds that string, to display the tonnage 2 colums back from it. Im about half way there a i think but am having trouble with strings, if it was numbers i could do it no problem

View 11 Replies View Related

Finding The Next Value Higher Than Reference Value And Printing Corresponding Values?

May 13, 2013

I have a reference value(say 'X') at L3, now i want to select a value next higher to this value(ie..'X') in the column ''C'' say and also i have to print the corresponding values of the row corresponding to B,C,D,E,F etc.

View 1 Replies View Related

Excel 2007 :: Extracting And Adding Values From Within Text Strings?

Jun 2, 2013

I am trying to extract values from a text string and add them up in Excel 2007. So far i have been successful in extracting the value out of the text string like this - =MID(I6,AD6,3) where AD6 holds the position number in the text string to start from. So it's working OK for one row but i need to do the same thing on multiple rows where the text string can be in different columns and I'd like it to automatically pick up the non-blank cell.

each row only has one column with text in it and the value i need to extract is always after "$". this is a working spreadsheet so the text string could move from column to column over time and I'd like my formula to be able to detect which column to read from. I then need to add up all the values from each row.

View 9 Replies View Related

Macro To Give Count Of Unique Values After Comparing Comma Separated Values?

Mar 2, 2014

I need a Macro (not formula) which compares the comma separated values present in Column "I" with individual values present in Column "D" and generate the count of unique values in Column "J".

The sample sheet has been attached for reference.

View 3 Replies View Related

Excel 2010 :: Produce Unique List Of Key Values With Second Values Concatenated Together

Sep 15, 2013

I have some data with recurring key values and differing values in the second column, I need to produce a unique list of key values with the second values concatenated together.(See below)

The data can be 10 rows to 5000 and I can have anything from 5 to 150 sheets (Separate data sets), a macro would go a long way to keeping me sane.

Sample data Required Output
A | B Z
1| 10 | a 10,a,b,c
2| 10 | b 11,a
3| 10 | c 12,a,b
4| 11 | a
5| 12 | a
6| 12 | b

My system is Windows 8 Excel 2010.

View 7 Replies View Related

Formula For Obtaining List Of Unique Values But Not Including Values Which Contain IC

Aug 14, 2014

1. Using a formula, I am trying to to obtain a list of unique values (string) (caveat: see #2) from the range E2:E10000 (arbitrarily chose 10000 - the row number is variable)(see #3).

I currently have a formula that seems to work for this purpose but I don't know how to add the condition in #2 (below)

2. To include all unique string values except those starting with the letters "IC"

3. Is there a way to make this formula so that it can only seek values up to the last row, and not go to the 10000th row if not necessary? The E column has no empty cells until after the last row that contains data.

Here is the formula I currently use which serves #1 (above):

[Code] .....

Any way to improve/simplfy this formula for the purpose describbed in #1? How can I add the condition in #2? Can you see a way to include #3? The most important issue here is #2.

Example of desired results:

Column A | Column B
AA | AA
DD | CC
AA | DD
CC |
DD |
DD |
IC |
IC |

View 14 Replies View Related

Count Unique Values In Column Based On Values In Other Columns

Mar 14, 2014

I'm running into an issue trying to calculate unique values in a Data column based on a few variables in other columns.

My current formula in Summary tab D4:D19 is
{=SUM(IF(FREQUENCY(IF(Data!$I$3:$I$66<$E$1,IF(Data!$A$3:$A$66=$H$1,
IF(Data!$C$3:$C$66=A4,ROW(Data!$I$3:$I$66)))),ROW(Data!$I$3:$I$66)),1))
+
SUM(IF(FREQUENCY(IF(Data!$I$3:$I$66<$E$1,IF(Data!$A$3:$A$66=$I$1,
IF(Data!$C$3:$C$66=A4,ROW(Data!$I$3:$I$66)))),ROW(Data!$I$3:$I$66)),1))}

This is currently counting the number of times a date value (data column I) appears for that name (A4:A19) in the data when meeting all of the conditions. I need it to instead count the number of times a unique date appears for that name with the additional conditions met (which all appear to work fine).

The results in the pink highlighted cells (Summary column D) should be:

Names starting with A - 3
All others - 2

I've left some other columns in the data with X's so that I can easily convert this back to my working spreadsheet.

View 2 Replies View Related







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