Delete Rows with Dates Between 2012 and 08/02/2014 - excel

I want to delete all the rows where dates in Column "X" are between year 01/01/2012 and 08/01/2014. I tried looking for a dummy code but couldn't find any.

Something like
for r = activesheet.cells(activesheet.rows.count,1).end(xlup).row to 1 step -1
if year(activesheet.rows(r).cells(1,"x").value)=2013 then
activesheet.rows(r).entirerow.delete
end if
next r
not test this, but this is how i'd do it, if it couldnt be done via filtering through VBA maybe?

It's no wonder that this takes forever. It has to calculate the whole if statement for 13000 cells.
Is this a one time only action? If yes, why dont you mark the whole table, then sort the data for column x. If column x is formatted as data then it should sort it normally (increasing or decreasing as you wish, I'd do it with increasing values) and then you can press ctrl+f, enter 08/01/2014 > press search and it should jump to the first line with this date. You can just delete everything above it. No need for codes that take for ever :)

Related

Detect running competition winner`s starting number in Excel

I have a task in in excel and I can`t think of the solution right now.
So I have a spreadsheet with running competition results: The table looks like this
So I need to detect which is the fastest runner that has ran all 3 laps (the winner) and detect the number(Nr) of the winner.
The F column is for calculations if needed
So I detected who had ran all 3 laps with this formula:
=IF(COUNT(C2:E2)>2;SUM(C2:E2);"DNF")
Then I determined who is the winner by running a min formula:
=MIN(F2:F79)
Now I need to detect what number the winner has, So it will be in the A column and in the same row where the row where =MIN(F2:F79) result is.
This is an task so manually finding it won`t work this time.
It is probably a really simple solution but I can`t think of it right now so it would be really nice if somebody could help out.
You can achieve this utilizing Index - Match.
The formula you would place in cell H2 would be as follows:
=Index($A$2:$F$79,MATCH($G$2,$F$2:$F$79,0),1)
What this does is it looks at the whole table and takes the Winner total time (cell G2) and matches it with the corresponding value in Column F, and then returns the first column (Column A).

Excel MAX/MIN but only if opposing cell is greater than 0

I've found similar examples through searching but I can't find anything that matches the issue that I have...
I have a table which shows parts received/rejected, I wish to see the maximum days early/late (I'll only need help with one as the other I can then do!)
- but there are dummy orders which I wish to ignore (they show a received/reject of 0).
Here is example data from the 'AnnualDump' sheet:
My current calculation is
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(AnnualDump!$G:$G))
[Column H is Received/Rejected and G is VarianceDays]
This simply looks at if there is any data on the sheet before running the calculation, which is fantastic for 95% of the time... but I want to ignore any values that have a received/rejected of 0...
I want it to show 29, but it's showing 30 in this instance as it's not ignoring 0qty lines.
I've tried adding another IF statement but it didn't work :/
Completely stuck now and not sure what the next step to try is...
I can do it if I cheat (call both columns to another sheet, turn text white, use an 'IF cell greater than x, then value' to compare the whole lot and then min/max that third column) but I'm trying to avoid that!
Any pointers or help will be greatly appreciated (complete VBA noob in excel so I'd like to avoid that if possible).
Thanks
Try this array formula. Confirm with Ctrl, Shift and Enter and curly brackets will appear round the formula.
I would strongly suggest you don't use full column references though as these formulae are rather resource-intensive.
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(IF(AnnualDump!$H:$H>0,AnnualDump!$G:$G)))

Time format not persisting

I have a calculation sheet, that checks if the rawdata has nothing in it, and if not, it will print the value of the cell.
Somehow, the timeformat is now left centered even though the cell-format and everything is the same as the above data.
I have tinkered with it for hours now and found no solution, so here i am hoping that someone knows what's going on.
SAMPLE FILE: https://ufile.io/dpe9u
Raw Data:
Calculated Data:
Result:
In the calculated data the (local, "HVIS" means "IF")formula is:
=HVIS('80 Rådata'!H951="";"";'80 Rådata'!H951)
I checked formatting and other settings, and everything seems the same, i even formatcopied from the rows where "it worked".
The data in column H sheet "80 Rådata" contains a few time values, but mainly text values that look like time values. Similar in column I, and J and K are all text values that look like times.
You can see that when you select the values and change the cell format to "General". Those that still look like times are text.
To fix that, select one of the columns, then click Data > Text to columns > Next > Next. In this step 3 of the wizard, specify that the data is a date (yes, a date). Then click Finish. Now all values are real time values, which you can verify by formatting as General again (then format back to time).
Repeat that with each column in turn.
From what I can see, the text values all have two zeros in the hour position. 00:01:30. If they had only one zero like this 0:01:30 then Excel would recognize them as time. If you don't want to repeat the data cleanup you may want to change your original data source to produce the correct format.

How to calculate the number of times a particular letter is typed on a cell in Excel?

I know the title looks enormous but I don't know how to put the title to the question I want to ask.
Ok, basically this is what I have so far:
On the spreadsheet I a column asking a question and the you fill up the row and according what you have there you have to put a Y (yes) or N (no).
On the end of the month we need to know how many Y (yes) we have, I need to do this manually. I was wondering, if there is a way to use a separate cell to count how many Y's we have on that column?
If someone could help on that I will very much appreciate.
This is completely possible. Depending upon which version of Excel you're using (2007 and later should work), try pressing Functions, and then choose AddCount, which counts the amount of something in a certain space.
If this does not work for you, you can also create drop-down menus inside of the Data Validation feature of Excel.
If you're making a form these two options will work.
If you have a column (say column A) containing either Y or N, then in a cell outside that column enter:
=COUNTIF(A:A,"y")
This will perform the counting and will count either upper case or lower case letters.
Select the excel cell where you want the output. Then go to function box and type =COUNTIF(CL1:CL100,"Y")
where CL1 is your stating column Index and
CL100 is your last column index till where you want to search.

Question regarding optimal excel function implementation

I have a question about Excel! I hope that isn't too unconventional for this site...
So I have an Excel table with several thousand rows. It is kind of setup like a db in that the first three of my four columns have numerical values identifying the sequence or order that the content or fourth row contains.
I am running into some possible duplication issues, and I am remembering back to my college days something about there being a function for the type of test I need to do. I need to verify that there are no two rows that have the same values for column 1-3. There should never be a time where all three columns' values match exactly that of another row.
Is VLookUp the function I need? Any excel experts out there that know of a function I could look into? Thanks so much!
the quick one-off solution I employ for this kind of quest is the following
create a single key in one temporary column - say F "=A2 & B2 & C2 ..." if combined key - I copy this formula all the way down
create a group counter for that single key - say G "=IF(F2=F1,G1+1,1)" - I can safely include the header row here because it will move the formula into the false part
This formula in G numerates all identical keys from 1 to N and starts by 1 for a new key - I copy this formula all the way down
Important: convert G formulae into values (copy / paste special onto itself)
sort descending by G and delete/manipulate all rows where counter <> 1 - or use autofilter
later on I delete F & G columns
this may sound a bit complicated, but especially in large tables VLOOKUP, COUNTIF's etc can be very time consuming.
Hope that helps
You could create another column that concatenates the first 3, then do a countif on that. Let's say the concatenation column is D and your data begins in the second row:
=countif(D:D,D2)
Copy the formula down, then filter on >1.
I think what you need is a countifs function.
assume you add one formula in a ceel in row 4:
=COUNTIFS(A:A,A4,B:B,B4,C:C,C4)
and copy to formula to the whole column
Then the cells with value 1 is a unique set while those larger than 1 have duplicates.
If you only need to check the data once, try the "Remove duplicates" functionality. This can be found in the Data tab -> Data Tools -> Remove Duplicates. Just unselect all but the first three columns in the dialog and Excel will do the rest.

Resources