Selecting every 3rd row in excel - excel

I am looking to select every third blank row in excel. Once I do that, I need to enter a formula into this third blank row that extracts the contents of a cell below. I would like to have it so this will be done for every third blank. A macro would be fine, I am just not familiar with VBA code so I am not sure where to start.
You'll notice that every third blank row contains the ID from column a in the row below it, and the name from column g below the third blank. Any ideas of how this can be done efficiently?

Just add a column which repeats every 3 rows and filter on that!
You may also be looking for Pivot Tables

Add two columns before column "A", so that your id column becomes column "C".
Now fill all cells with value 1 till the last of your data range in column "A".
In cell "B1" use below formula & fill down till your data
=ISNUMBER(D1)
Now add filter ( Ctrl + Shift + L ). And filter data in column "B" with "FALSE"
If you can follow these steps exactly, you will get all rows you want.
Then use this formula in Than apply filter.

Related

How to remove data from a cell if all other entries in the row are empty?

I need to delete the value of a column if a particular column in the same row is empty
I have done the removing until now manually but it takes a lot of time
AGRO ENGINEERING WORK
Educational 19-20/4444 352254.00 27
352254.00
I need to remove the third row(column d) amongst the code if the value in column a is empty
here is my suggestion.
try sorting the sheet on column A.
go to the first blank cell in the same column.
all the following rows have blank cells in column A.

Finding unique values between 2 Excel columns

I have two simple columns in Excel below
ID ID1
123 123
124 125
125 126
126
I was able to use the conditional formatting in excel as follow:
1. Highlight the 2 columns
2. Click on the conditional formatting
3. New rule
4. Select format only unique or duplicate values
5. Select unique under format all:
6. Select Format and click ok.
I can see that the steps above shows the highlighted value which is 124.
My question is, how can I filter out that 124 value from such a small sample above?
I have a columnA that has 50k records and columnB that has 48k records. I want to see or filter out the 2k records from columnA.
Here's one approach using match and a filter.
Enter =MATCH(A1,B:B,) in column c add a filter to row 1 and filter for column C values that are #N/A the values in column A which say #N/A in column C are not in column B.
An alternative approach would be to move the column B under Column A and use COLUMN b to define the source ID, ID1... and then use a pivot table to show you both sets and what could be missing from each...
Notice how 5 is not IN ID while 13 is in ID but not in ID1.
also notice that duplicates on Row 5 show up as well.
One way of doing this (kind of manual) is to find the values which are duplicates (the ones that are highlighted). Then select both the columns and all the data.
Then go to: Home > Editing group> Sort & Filter > Filter
There should be small, down arrows on the column headers. Then you can un-check the duplicates.
EDIT
Thanks to xQbert for pointing out my mistake. Here is a way to solve this:
If possible, you can move the second column to another worksheet. Now use the following formula in a column next to the first column:
=COUNTIF(Sheet2!A2:A5,Sheet1!A2:A5)
Just change the cells to the ones for your table. The first parameter is the second column (which you should have put in the new sheet). The second parameter is the first column which will be highlighted. This will put a '1' next to each value which is duplicated.
Then you can use conditional formatting to highlight the cells with a '1' next to them using this formula in the "New Rule":
=B2=1 That is the cell number of the first cell in the first column. It should be highlighted to the colour you set it to. To copy the formatting to the rest of the cells, click on the first cell B1. Then go Home > Format Painter. Drag the formatting to the entire column.
You can then use the filter to show only the cells with "No Fill"
You will have to do the same for the data in the new sheet.
This was a very 'hacky' solution but it's what is possible.

How to duplicate and show a specific row in new address in excel 2007

I use excel 2007
i made a table with few columns but too many rows. Each row contains some data and simple formulas.Now I want to duplicate a specific row based on current date [TODAY()] at top of the sheet.I mean whenever I open the file,the right row according to computer date,be shown directly at somewhere else instead of looking through all rows to find it.
thanks
above your table. add an empty row.
First column add =TODAY() // This will show todays date in the column and can be used in your other formulas. We will assume the cell is A1
Second Column add = VLOOKUP($A$1,A2:D8,2,FALSE) A1 being the date, A2:D8 being the table range (A2 top left cell, D8 bottom right cell), 2 is the second column of your table range, false returns the value in the second column as longs as the date (A1) matches the date in the first column on your table range.
Copy the formaula across the columns, changing the lookup column in the formula. ie. Third column VLOOKUP($A$1,A2:D8,3,FALSE)
Glad to help.

Sort row data into columns with same heading in excel 2010

Put simply, I need to sort row data for a specific range into the correct columns based on that columns heading. For example, if there are five columns labelled A through E, and data in the rows below ranging from A through E; I need all of the A's to be in the A column, all of the B's in the B column etc.
Example start data:
How it should look after the sort:
It also must be able to work with the possibility of having empty cells. For example; if the first example data had no B in row 3, the data must not shift over to the left so that C is in the B column etc.
Other info: not feasible to do by hand - over 450 rows.
It also must be able to work with the possibility of having empty cells.
Taking the above into consideration.
NON VBA WAY
Insert enough columns so that the data moves to the right
Next in the row one, duplicate the values from your data
Next in Cell A2 Put this formula
=IF(COUNTIF($H$2:$L$2,A1)>0,A1,"")
Copy the formula to the right
Next remove "$" from the table range and add it to the header in formula in Cell A2 so that we can copy the formula down. This is how it would look
=IF(COUNTIF(H2:L2,$A$1)>0,$A$1,"")
Similarly your B2 formula will look like this
=IF(COUNTIF(H2:L2,$B$1)>0,$B$1,"")
Change it for the rest
How highlight cells A2:E2 and copy the formula down.
Your final Sorted Data looks like this.
Copy columns A:E and do a paste special values on Col A:E itself so that the formulas change into values and then delete Cols H:L

Count values in groups

I have a table with student IDs separated in groups. I need a handy way to count the total number of students in each group and populate it after the last row of each group (marked with ??)
Currently I just enter =COUNT() and then manually figure out the top and bottom borders of the range for each group. Not convenient at all.
I was thinking that a possible solution could be one of the following:
A some kind of pivot table permutation. I failed on this one.
Excel Data->Outline->Subtotals functions. Again, fail. It keeps creating new rows in my table.
A universal formula that can be pasted into each ?? cell. Not the most graceful solution, but still would do.
A macro. As a last remedy if nothing else works.
The following steps will calculate the subtotals while preserving the structuring and formatting of your worksheet.
Put this formula in cell C1 and copy the formula down the column:
=IF(NOT(ISERROR(SEARCH("Total",A1))),COUNTA(INDIRECT("B"&MATCH(LEFT(A1,LEN(A1)-7),A:A,0)+1&".B"&(MATCH(A1,A:A,0)+1))),IF(B1="","",B1))
Apply a conditional format to cell C1 with the formula rule =(MOD(ROW(C1),2)=0) and blue fill to match the shading on the other rows. Copy the format down the column using Paste Special Format.
Either hide column B, or copy the values in column C to column B using Paste Special Values and hide Column C. If you decide to copy the values to column B, you won't need to set the conditional formats.
Here is what the formula does:
First, check whether the formula's row is a Total row, by searching the cell in column A of the row for the word "Total," using the SEARCH function.
If the word "Total" is found:
Determine the range in the worksheet of the student IDs for the group for that total row:
a) Identify the rows in which the words "GroupX" and "GroupX Total" are found by using the MATCH function. With that, you know that the IDs for the group are in a range that starts at, say, row x and ends at row y.
b) With the starting and ending row numbers, construct the address range in which the IDs lie, which has to be the string "B" + (row x) + "." + "B" + (row y).
c) Turn the string into a range reference that can actually used in a formula using the INDIRECT function.
Count the number of students in the group using the COUNTA function and the range, and show that as the formula's result.
If the word "Total" is not found
Check whether the cell in column B is empty
a) If it is empty, show a blank as the formula's result
b) if it is not empty, it must be a student ID, so show the ID as the formula's result.
Add a column (I usually add it to the LEFT of the existing matrix) where you enter a formula from row 2 onwards that fills the blanks in the old column A. Then the old matrix including your new column can be used in a pivot.
So Insert a column left of your matrix, this is column A now. Put a header in Cell A1, for example "Group Name1"
Enter the following formula in cell B2 and extend it to the end:
=IF(B2="",A1,B2) This way your blanks will be filled.
Now apply a pivot on this matrix and there you are.
Maybe not the nicest looking solution, but its quick and works well.
If u have table like this
Students id Name of students group ........
then u can use countif/countifs formula

Resources