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
ADVERTISEMENT
May 5, 2008
I will say exactly what i want.
I want to keep statistics of roulette.
More specifically, i want to count how many times a dozen lates to come.
The range from 1-12 is 1st dozen, from 13-24 is the 2nd and 25-36 is the 3rd.
I want to count among these numbers, how many times one of three dozens appear every 1 time, how many times appears every 2 times, .... until 20 times.
For example: I have put in a column 500 numbers from 0 to 36.
The output must be like this:
1st Dozen: Every 1 time: x
Every 2 times: n
Every 20 times: m
The same for 2nd and 3rd dozen.
View 9 Replies
View Related
Aug 19, 2012
In a cell i need this info when
column a = month
column o = staff member
column m = discount given
if no discount is given column m will show 100%
i need the total of all sales made with a discount i.e not 100% and not blank, in a certain month, by a certain member of staff
step 2: i need the average of all these for each member of staff shown in a different cell
i already have the total sales counted per staff member so this will show me who is doing deals and who is doing the biggest deals.
View 4 Replies
View Related
Oct 27, 2008
I am sure that most of you will probable know what i am doing wrong here straight away so rather than me waste another 1/2 hr stuffing around. I am trying to find count the number of times two events occur simultaneously.
=SUMPRODUCT(--('5. Financial'!AX4:AX134=A5)*('5. Financial'!BQ4:BQ134>0<0.1))
The first part is fine I think but in the second part I am trying times only when cell is between zero & 10%.
View 3 Replies
View Related
Mar 15, 2014
I'm trying to create a master template for doing cash flow projections for a number of years. Ideally I would like have a cell for the number of years I want (10 for example) and have excel populate a group of cells based on that number. Each row of cells would be one year and each column would be one month. The dates would be calculated based on a starting date that I enter into a cell.
After that I would like to have a cell for starting cash flows ($1,000 for example) and then another cell that I can plug increases into. For example cash flows may increase to $1,250. I would also need a cell for the date cash flow increases go into effect (1/2019 for example).
View 1 Replies
View Related
Aug 4, 2014
I am a behavior specialist and I have created a spreadsheet to determine what possible antecedents trigger certain behaviors. In other words, I want to know what occurs, like being around an unfamiliar person, right before a person engages in an "acting out behavior" like becoming verbally or physically aggressive. In my spreadsheet I have a number of possible antecedents with a number of possible behaviors. It is tracked by the date that the behavior occurred.
View 6 Replies
View Related
Dec 25, 2012
Build table with 2 matching condition.
View 6 Replies
View Related
May 17, 2009
I have a table which, when populated, gets huge. The example I am showing here is greatly simplified.
I need to be able to provide a summary report that shows a count of entries (rows) that meet either TWO or THREE criteria, and one of those criteria is date-based.
For the date-based option, I need two possibilities: 6 months ago, and 12 months ago.
In the attached example, then, I would need to see:
- How many entries were for Purchasing and were Complaints in the past 6 months? (answer should = 2)
- How many entries were for Shipping and were Complaints in the past 12 months (answer should = 2)
- How many entries were for Shipping and were Compliments in the past 12 months (answer should = 1)
And so forth.
Here's the rub. All of this can be done with array formulas, and an EDATE cell that calculates today's date -6 months, and one -12 months. The problem there is that there would be so many array formulas (I need to do a lot of permutations), plus utilizing the volatile TODAY(), that the sheet slows down DRAMATICALLY in calculation time.
Secondly, this is for a user that is not Excel savvy. So the solution not only should not slow the calculations down, or require them to set Excel to manual calculation, but it should also NOT use Pivot Tables. (Simple users are confused by pivot tables, sorry to say... and they are a heck of a thing to format nicely for the boss to look at.)
And, of course, we can't use VBA.... that will also confuse the client.
So I know the best answer lies in database functions. I just cannot figure it out.
View 11 Replies
View Related
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
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
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
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
Jan 20, 2014
I need a way to find a value in a column which has one or more corresponding values in an adjacent column. Then take all of the corresponding values found and count all occurrences of the found values in another column. But I only want to count the entries if an adjacent column is not blank.
Not the easiest thing to describe. Starting to wonder if I need to think in reverse. I hope the attached example makes more sense.
Book1.xlsx
View 2 Replies
View Related
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
View Related
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
Mar 14, 2008
I have a problem, I have a formula which counts the number of instances that occur and assigns the value as 1 for every instance, however I want the formual to also recognise that if a number of instances occur in succession a value of 1 should also be assigned.
E.g. if a person is absent for 1 day the formula assigns a value of 1
if a person is off for 3 days in succession the formula assigns a value of 1
View 13 Replies
View Related
Jan 13, 2010
I would like a formula (if it is possible) that will list which months occur between two dates;
i.e
Start Date (Cell ref A2) = 01/01/2010 (in the dd/mm/yyy format)
End Date (A3) = 02/05/2010
In cells D2:O2 I have the months Jan-Dec. In cells D3:O3 I would like a "Yes" to appear if the above month occurs between the dates in A2 & A3. In this example would like a "Yes" to appear in cells D3, E3, F3, G3 & H3 but not in the other 'Months' appropriate cells.
View 2 Replies
View Related
Sep 19, 2007
i need to delete rows from sheet2 which contains source data for Vlookup on sheet1.
that is i need to run a vlookup for a value in sheet1 and after the value is obtained , delete the row which has that value in the source data......
i am sure a simple for loop will help but it needs to do the events in sequence:
vlookup for row1> fetch / place value (sheet1) > delete data in the source table (worksheet2) > go back to row2 and repeat till the the last.. or till the end of a predefined range..
View 9 Replies
View Related
Jul 24, 2009
Basically my sheet links may appear as a cell in another tab or it might be to an http address... Here is my formula I have setup up right now.. Only problem is, no matter what I put into the logical test to get a "true" result for the http addresses it still says false..
View 2 Replies
View Related
Nov 20, 2013
I have a spreadsheet with over 15 columns showing drivers (names numbers etc) and their duties with more inf.
What I need is to be able to find when a certain type of driver in column A (drivers belong to different rutes) say from route A is at rest (this is shown as RD) which is shown in column B and then be able to count how many times those two exact events occur.
View 1 Replies
View Related
Sep 23, 2005
I require a Formula to calculate the INTERVALS (the number of Rows between
the LAST instance and the PREVIOUS instance in a column) between each
individual occurrence of any designated PAIR of Numeric values (single-digit
/ double-digit) in the same Row of the Named Range "Results" and return each
calculated INTERVAL result to a separate Column on the same Row of a New
Sheet - starting with the most recent ( the LAST) occurrence.
For instance, each time 80 and 87 appear together in the same Row, return the
INTERVAL by calculating the number of Rows between the LAST instance and the
PREVIOUS instance in a column - locate when both Numeric values LAST appeared
together and Count back to their PREVIOUS appearance together to get the
required Count; i.e. count from the Row ABOVE LAST appearance to the Row
BEFORE PREVIOUS appearance.
The results are returned to a chart / matrix layout: I have the criterion
vertically and horizontally and they are referenced using the horizontal and
vertical cell address that houses each criterion, and the results are
returned across the Row of the intercept of the vertical and horizontal
criterion. At some point both criterion values being referenced will be the
same, can the Formula return empty text "" when this occurs?
Example Chart / Matrix Layout:
Cell Ref. A2 and B1 criterion 80 and 80
Cell Ref. A3 and B1 criterion 81 and 80
Cell Ref. A4 and B1 criterion 82 and 80
Criteria B1 houses 80
A2 houses 80
A3 houses 81
A4 houses 82
A5 houses 83
View 12 Replies
View Related
Jan 14, 2013
I am trying to determine whether or not 26 blanks occur in succession in a row. Two example rows of data are listed below, where "_" refers to a blank cell:
2 _ _ 3 _ _ _ _ _ _ _ 4 5 6 3 4 _ _ _ _ _ 4
_ _ _ _ _ _ 7 8 13 2 3 _ _ _ _4 5 6 11 10 2
Hopefully you can picture the data from above. Anyway, there are multiple locations where a string of blanks occur. I'm looking for a formula that can test as to whether or not a certain number of blanks occur in succession during any part of the row.
View 10 Replies
View Related
Jan 25, 2012
I have a long column of 9-digit numbers which represent the swipe-card-ID's of patrons accessing a parking facility. Most of them occur more than once, some of them many times. There is an operational rule that bars them from using the facility more than x times. (I can't implement this limitation in the parking software/hardware, or I would happily do so.)
So my question is, is there a way to process through that column, identifying each unique ID, and reporting any that occur more than x times?
View 1 Replies
View Related
Jan 18, 2014
Essentially what I want to automate is a check through one list on the Sheets("Notes") in column A, with another column B on Sheets(template). If there is a match I want to insert a part of the row that the match occurred on Sheet("Notes"), and insert it above the row where the match occurred on Sheets(template).
Here is my code so far, currently I keep getting a "Application-defined or object defined error" on the line
VB:
Sheets("Notes").Range(Cells(i, 2), Cells(i, 11)).Copy
VB:
Sub add_notes(template As String)
Dim Rng As Range
Dim i As Integer
[Code].....
View 5 Replies
View Related
Feb 26, 2014
Attached is an example of an excel spreadsheet I have which details all the referrals created within my organisation over 2013. I want to be able to create two excel formulas which basically looks at a duplicate tag and then determines if the duplicate referral was created within 30 days of other referrals created for the same patient and then another formula to check to see if the duplicate referral is for the same medical condition. Also if possible I would love a third formula which would say check duplicate, 30 days and same condition and enter a "Yes" in a forth column.Referrals.xls
View 8 Replies
View Related
Sep 25, 2007
The file is a simple sheet which upon entering the actual/Invoice cost (C5), calculates the estimated landing/final cost (C8).
In between the process involves changing the currency from US$ to PKR, make some calculations, and changing back the currency again to US$.
The default rate of currency exchange is set to ave 60 (C12). However if the user knows the current rate he can put it manually in C6 and sheet will make all the calcs on this instead of using the default rate.
Problem:
Everything is working just too perfect. But probs occur when i manually enters the exchange rate.
It does successfully changes the US$ to PKR and calculates everything perfectly but doesnt reverts the final cost back to US$ successfully instead it keeps using the default value instead of user's value
View 7 Replies
View Related
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
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
Sep 13, 2006
I have an array that I'm using - and it works perfectly: =SUM(If((FREQUENCY(If(LEN(B10:B100)>0,MATCH(B10:B100,B10:B100,0),""),If(LEN(B10:B100)>0,MATCH(B10:B100,B10:B100,0),""))>0),1))
Now, what I would like to do, is see how many of these unique numbers relate to another number in column D
See attachment.
View 4 Replies
View Related
Jan 17, 2014
I would like to achieve the following without using vba if possible, though I realise it may not be possible.
Using a formula, I want to count the number of rows which contain one or more of a number of options.
[URL] ....
In the picture there are 6 or so clients: The columns to the right indicate with the letters A, B and C whether these individuals have traits 'A' 'B' or 'C'. So effectively I just want to count the number of clients(rows) which have one or more trait.
Question: Can I do this using just a formula, and if so, how?Workbook attached.
Linked Post: [URL] ....
View 4 Replies
View Related