How to count how many times a rule appears in a specific month.Exce; - worksheet-function

I want to count how many times in a specific month(for example:January) the red cell with the rule: equal or more than 15 days -> red cell , appears. How can I do that?
My table looks like this
A B
16.02.2013 15
17.01.2012 20
01.02.2013 4
26.04.2012 10
01.01.2012 21
20.04.2012 7
The answer for January is 2
How can I do if I want to make the count by month and year?
Thank you in advance!
Lygia

You can use the countifs function for this. (Link)
Assuming C1 holds start date you want to count from, and C2 holds end date you want to count too.
=COUNTIFS(A:A;">="&C1;A:A;"<="&C2;B:B;">15")
Not sure if you can tie the condition directly to the formating rule.

I'm guessing that entries in ColumnB greater than or equal to 15 have been formatted red. (Which could imply a flaw in #Taemyr's answer, where >15 should perhaps be >=15.) Also, that the likes of "(for example:January)" implies that a solution that works conveniently for many months would be appreciated, so suggest a PivotTable.
Due to PT constraints, identification of values greater than a cutoff is easier in the source data. In this case should only require filtering to select values that have already been formatted red, and adding a flag, say x, to these.
Then the PT could be filtered for x only and the ColumnA values (ROWS) Grouped by Years and Months. The sum of VALUES field being Count of B.

Related

Google Sheets calculate characters only once

Is there a formula in google sheets to calculate a character only once. For example, if a row has 5 columns (Monday-Friday) and there are 2 or 3 columns marked with X. How can I calculate how many rows have an X. I don't need to know how many Xs there are just how many have an X?
Reina, I have one answer, though there may be better ones.
This formula, pasted into B34, should do what you want. It merges all the cells in column B to F, in each row, into one value, substitutes out possible spaces, then checks if it has at least one "y" (as used in your example.
=COUNTIF(ARRAYFORMULA(
SUBSTITUTE(B4:B29&C4:C29&D4:D29&E4:E29&F4:F29," ","")),
"*y*")
It is coded to search all student rows, ie. between 4 and 29 - change these row numbers if necessary.
If the attendance might be marked with something other than a "y", you could change the "y" part of the formula to "?*". I just didn't know if other values might be used, eg. an "S' for sick day or something, and you wanted to ignore those.
Then, you can drag the new formula from B34, sideways on row 34, to G34 and beyond, and it should calculate the results for the subsequent weeks. It will shift the columns being checked by the formula automatically.
Let me know if this works for you, or if you need something else.
To possibly ease data entry, here is a sample sheet with the formula, but with check boxes replacing the cells where attendance is marked.
https://docs.google.com/spreadsheets/d/1ON5Rc55aLVq_LHtFOfpgmf876bYg2ITfwpbifklr3lU/edit?usp=sharing
Here the formula is slightly modified to look for "TRUE" values, instead of "y"s.
UPDATE: To look for ANY non-blank cell in that range, and count "1" for every student that week that attended at least one day, the formula is:
=COUNTIF(
ARRAYFORMULA( B4:B29&C4:C29&D4:D29&E4:E29&F4:F29), ">""")
or
=COUNTIF(
ARRAYFORMULA( B4:B29&C4:C29&D4:D29&E4:E29&F4:F29), "?*")
See sample here:
https://docs.google.com/spreadsheets/d/1ON5Rc55aLVq_LHtFOfpgmf876bYg2ITfwpbifklr3lU/edit#gid=461771088&range=B34:F34
Let me know if this answers your question, or do you need to do something specific with the "y,x, and o"s?

How to filter rows in which at least a defined number of observations is greater than a specific value?

I have a data frame with 9 columns and many rows. I want to filter all the rows that have observations greater than 3.0 in at least 3 columns. Which conditional statements should I use to subset my data frame?
Since I am a n00b, I only came up with this:
data_frame[data_frame > 3,]
Obviously, this gives me all the rows for which all values are > 2, regardless of what I actually need.
Thanks!
I figured that you could also combine logical operators:
data[rowSums(data>2)>=3,]
Like this, you can subset from a data frame the rows for which the sum of observations (higher than 2) occurs three or more times. And no specification for the columns.
Logical operator, in this case, the brain. I used the sum(rowSum(data))>x # x =sum of the limit value times columns available.

TableSorter Alpha before Number sort

I have seen and tried the options to have
textSorter: {
// plain text sort
3: $.tablesorter.sortText
},
and setting the class of the column to class="sorter-text"
and setting the stringTo: "min",
Each time I add in one of the options above, I see the sort change, but in the end the values in the column do not sort the numbers correctly in the order within the alpha sort. The alpha sort puts them in the correct order but not the numeric part.
The values are:
Past Due by 3 Days
Past Due by 23 Days
Past Due by 0 days
Due In 1 day
Due in 2 day
As you can see the alpha is in the right descending order but the numeric part is only going by the first digit of the number (also descending) and not the number value so it is order of sequence. So it should sort by alpha then sort by the numeric value within that alpha sort. I cant be the first person to have this problem. I have searched and found the many solutions shown above but they do not seem to solve this specific problem. some would say to move the digits to the front of the string and then sort by digit only, but then all the past dues and due soons are mixed together and that is not the desired result.
I have seen some options to create my own custom parser, but I really can not believe in the year 2018 that tablesorter (I just started using it) still has this basic issue with sorting.

Advanced Excel Search and Sorting

I have a incredibly large spreadsheet that lists details for the computers in my company's inventory. We need to know how many systems we have that are x years old. I was able to sort it by model but because the model names are wildly different it didn't help much. For example, one model name is
13-inch MacBook Pro (2011)
And another is
13-inch Retina MacBook Pro (Mid 2017)
The only constant value in the parentheses is the year at the end. I'm trying to write a formula that will spit out how many of each system there are. We need to know how many are 2011 computers, how many are 2017, etc. We are fine with grouping up "Early, Mid, Late" since we just need a year separation but those terms don't show up in every cell throwing my math off. The rows don't have to be sorted, I just need a count.
My plan of attack would be to first, convert the spreadsheet into a table using Insert > Table... this enables Excel to manage calculating columns for you.
The following assumes that the cell at the top of your list contains the word "Detail".
Second, I would make a new column at the far right with an equation like this:
=mid([#Detail], find(")",[#Detail])-4, 4)
...and I would tune the "Find" function and the "mid" function until it gives me just the year.
Third, sort the entire table by this new column. Tada!
Transfer the data to column A. Cells A1 to A1000 in my Example.
In Enter the years in column C. Cells C2 to C20 in my example.
In cell D2, enter the following Array Formula, and drag it down.
=SUM(IFERROR(IF(VALUE(LEFT(RIGHT($A$1:$A$1000,5),4))=C2,1,0),"-"))
Array Formulas are entered using Control + Shift + Enter, instead of Enter.
The Formula takes the last 5 characters of all entries in the column A. Then it takes the first 4 characters of this new text (to eliminate the closing bracket) and converts the text entries to numerical values. It matches each entry with the year in column C, and totals the matches.
I hope this solves your problem.
Regards,
Vijaykumar Shetye,
Spreadsheet Excellence,
Panaji, Goa India

OBIEE: Finding frequency in pivot table

I have a pivot table that looks like this:
My hope is to make the columns of the anomalies (A,B,C,D,M) that is the frequency of the anomaly. So that the column is basically
Anomaly/# of Inspections
How can I change the format of these cells to show this frequency so that they can be then plotted over time?
From your question, and a little help from the comments on it, it seems you want to display the volume of anomalies as a percentage of the number of inspections. For example in week 11 you had one Anomaly C, which would be 20% of the 5 inspections.
To display 20% instead of 1, the only way to do this is to change the column formula in the criteria to pretty much what you wrote in your question.
100*(Anomaly/# of Inspections)
You can't do this through formatting – you can't format a number into different number, you have to change the calculation to do that.

Resources