I have the following formula:
=INDEX(TODAY!$D$2:TODAY!$D$306; MATCH(0; COUNTIF($A$2:$A2; TODAY!$D$2:TODAY!$D$306);0))
in the above example 306 is the number of ROWS in D column of the TODAY sheet that I get from the following formula:
=COUNTA(TODAY!D2:TODAY!D2000)
I can't figure out how to merge these two formulas together, so that in A column I get unique values for number of rows generated by second formula. Because if I copy the first formula along the A column it starts repeating from the beginning same values.
For example, what happens now is if I have 5 unique records in TODAY sheet but i copy the formula in 10 rows of A column it repeats those 5 records again. But I need to get only 5 records, others must remain blank.
Thank you!
One approach is to use OFFSET.
Here's a list of animals and we want to count horses and the list can grow but it's fixed on A2:A12.
To make it dynamic use OFFSET and your COUNTA formula e.g.
OFFSET(A2,0,0,COUNTA(A2:A40))
Which replaces the fixed A2:A12 range in the example.
Related
i have an excel sheet in which the first few columns contain titles and information and the rest are repetitive 3 columns sets (i'll refer to as col1,col2,col3), containing dates.
i added an other 3 columns set in which i want to show the last date set in that row(i'll refer to as last1,last2,last3).
currently i set "last3" to look for the last non blank cell in row, last2 to look for the one before and last1 2 before.
problem is, not every time i fill the information i fill the whole set, meaning i could have a situation where the set contains col1 col2 values but not col3, then last3 actually takes a col2 value and messes up everything.
is there a way (please please no VBA programming) to write an array function of some sort that looks for the last 3 col set containing any value, and copying it to the last col set?
thanks!!
I have cooked up this formula for you. It isn't pretty and it's volatile (meaning, it will slow down your worksheet if you have a large quantity of these formula in it) but it does the job. It's the same formula for all columns and all rows.
=INDEX(INDIRECT(ADDRESS(ROW(),1)&":"&ADDRESS(ROW(),COLUMN()-1)),,COUNTA(INDIRECT(ADDRESS(ROW(),4)&":"&ADDRESS(ROW(),COLUMN()-1)))-MOD(COUNTA(INDIRECT(ADDRESS(ROW(),4)&":"&ADDRESS(ROW(),COLUMN()-1))),3)-(2-MOD(COLUMN()-4,3))+(4-1))
In this formula the number 4 stands for the first column of the first set of 3. If you have more columns to the left or fewer, change this number wherever you find it.
The number 3 stands for sets of 3 columns. the "2" in 2-MOD(COLUMN()-4,3)) is also related to this number being used here to reverse the result of Mod(,3) which will be 1, 2 or 0.
-1 generally stands for an adjustment, for example COLUMN()-1 is the number of the column to the left of where the formula resides. But in ADDRESS(ROW(),1) the "1" specifies column A.
The formula specifies a range starting from column 4 to the last column to the left of the formula and counts the number of entries in it, excluding cells of its own group. The 3 entries to be retrieved are in the range extending from itself 2 cells to the left.
If you deploy this formula, replace it with hard values when you add the same formula to the right of columns where it is already deployed. Use Copy/Paste Values (after copying the formulas to the right. This is to reduce the load on your worksheet.
BTW, I took a hard look at this thread, where they deal with columns. Some of the solutions there can be reformulated to work on rows but I failed to make them work on sets of 3.
How to reproduce cells that are in the same row a certain time? Please see the screenshot.
Use INDEX function to reference each of your text ranges as a 1D range.
Then you just need to develop two counters. The first counter will increase by 1 every 4 columns, the other will reset/loop every 4 columns. Use these counter to pull the appropriate cell address from the INDEX Function.
The following formula increases by 1 every 4 columns:
=INT((COLUMN(A:A)-1)/4)+1
The following formula loops a count of 1 to 4 as its copied to the right:
=MOD(COLUMN(A:A)-1,4)+1
Combined with with an index you can use the following formulas:
Names
=INDEX($A$1:$G$1,INT((COLUMN(A:A)-1)/4)+1)
Letters
=INDEX($A$3:$D$3,MOD(COLUMN(A:A)-1,4)+1)
Note the formula will produce an error if you pull it too far to the right as it will run out of names in the index to reference. It will work for a maximum columns Number of Names X Number of Letters, or the Maximum number of columns in your spreadsheet, which ever is smaller.
If you have Excel O365 with dynamic arrays and the SEQUENCE function, you can use these formulas in a single cell.
The results will SPILL over the requisite number of Cells, and adjust if you change the data ranges.
I used Dynamic named ranges for the two rows of information you have, but you could use Tables, or other methods:
A7: =INDEX(myMonths,1,INT(SEQUENCE(,COLUMNS(myData)*COLUMNS(myMonths),1,1/COLUMNS(myData))))
A8: =INDEX(myData,1,MOD(-1+SEQUENCE(,COLUMNS(myData)*COLUMNS(myMonths)),COLUMNS(myData))+1)
I thought a bit and figured out a simple solution as shown in the screenshot.please see the formula here
Formula to add all occurrences where a name pops up in a column (multiple columns) and return the summed value of all adjacent cells. For more clarification see
Example Attached
In this circumstance I want it to find all of Jim's adding to 5, all of George adding to 4, and all of Terry adding to 7. The challenge is each column will have the names randomly assorted and some times the name may not show up for that day.
Is it possible to search all days for the month (for this example) and add the total of the adjacent column for each person if I input their name?
I was looking into SUMIF functions but I can only get that to work if its all in 2 columns, with the way this one is approached I can only work through multiple columns.
Thank you for any assistance!
Use SUMIF, You will need to provide the list of names:
=SUMIF(Y:AC,"Jim",Z:AD)
Note the offset but same size ranges. Also change "Jim" to a cell that contains the name you want to sum.
I feel like this should be really easy, but I can't figure out the commands.
I have data in columns C and D which either contains a date or is blank. I have data in column H which contains the name of an employee. I want to calculate the total number of times, for each individual employee, non-blank values occur in C and non-blank values occur in D.
CountIf doesn't quite seem to have the capacity to do this. Any ideas?
In addition to previos answer, if your criteria is for non-blank cells:
=COUNTIFS(H:H,"YourName",C:C,"<>"&"",D:D,"<>"&"")
If you are using Excel 2007 or later, use
=COUNTIFS(H:H,"YourName",C:C,"",D:D,"")
I have a spreadsheet and I need to match the two columns together. However "Dove code" is 3600 rows and "code 2" is 1100. They all have the same codes as you can see in the image but you can also see where it starts changing and I need to have the codes all line up so I can see the gaps. I have already arranged them all alphabetically and its the "code 2" that would need to match up to "Dove code
If the above solution would result in too much shunting and vba is not an option, there's another way. Copy the first column and use 'remove duplicates' on it. Now you have an index list, put numbers from 1 to x in the column on the right of it.
Insert a column between the two lists and right of the second one.
Assuming that the index list is in F and the numbers in G, put this formula in the cell right of the first cell in the larger list:
=VLOOKUP(A2,$F$2:$G$500,2,FALSE)
Adjust the range accordingly. Put the same formula in the cell right of the first cell in the shorter list, with of course C2 instead of A2. Copy both formules to the end of the list.
Now both columns have an index on every row. You can match them using data sort, but for that you need to add dummies in the index columns.
Put this formula in the cell right of your basic index list: =countif(B:B,G2)
And this one in the cell right of that: =countif(D:D,G2)
Now you know how many times each record arises in both lists. Just add extra numbers manually so that both formulas turn up the same result. You should be able to do that really fast. If you have 200 records that are used 2 times in the first column and not in the second one, just copy the index of those 200 records and paste them twice. The countif's will automatically update.
You can use an extra column to calculate the difference between the two counts and use data sort on your basic index list to sort on the diferences.
After that just use data sort.
IF my directions are clear enough, this shouldn't cost you more than 10 minutes.
Edit:
Here's an example: http://img14.imageshack.us/img14/6366/k8pg.jpg
Without VBA I do this (for columns with a limited number of mismatches!) by adding a formula such as =INDIRECT("A"&ROW())<>INDIRECT("B"&ROW()) in a helper column. Working downwards, every time you see a TRUE shunt the appropriate column down to suit. But it may be only just about viable for 1100 rows!