I have a [Date] column and a [STATUS] column. [Status] can be either "Up" or "Down". I want to count the number of days [STATUS]="Down"
date status new_calculated_column
1/1/2001 up 0
1/2/2001 down 1
1/3/2001 up 0
Any suggestions?
This will work using SUM or COUNT
SUM(IF([STATUS] = "Down",1,0))
or....
COUNT(IF([STATUS] = "Down",1,0))
Related
I have 2 sheets named A & B.
A has 3 columns (ID, Date, Name) and B has 3 columns (ID, Status, Level). A.ID and B.ID are same.
I want to count the status(two information “Done” or “Not Done”) based on A.Date range.
My Formula is:
=COUNTIFS(A!A2:A1048576,B!A2:A1048576,A!G2:G1048576,">=01-01-2020",A!G2:G1048576,"<=30-06-2020", B!B2:B1048576, “Done”)
But every time it shows 1. By manual filter it shows 12.
Adding a column (i.e. F) with formula: =A2=B!A2, and doing:
I created a 'sample' with only 17 rows, and i use ';' a separator in formula's (😕)
=COUNTIFS(B!B2:B17;"=Done";A!B2:B17;"<=01-08-2020";A!B2:B17;">=01-02-2020";F2:F17;"=TRUE")
CriteriaRange1: B!B2:B17
Criteria1 : "=Done"
Only count values that are "Done"
CriteriaRange2: A!B2:B17
Criteria2 : "<=01-08-2020"
Only count when date is (on or )before 1 August
CriteriaRange3: A!B2:B17
Criteria3 : ">=01-02-2020"
Only count when date is (on or )after 1 Februari
CriteriaRange4: A!F2:F17
Criteria4 : "=TRUE"
The formula in F checks if A!A2 is equal to B!A2 (for all rows)
I do hope there is an easier way to do the Criteria4 😉
Is there a way to sum values in a column between two different time. The two different hrs are different for different start and end calculation. The formula i used is =SUMIFS(Period,time,">="&Time Range,time, Range,"<="&Time Range) , but the formula returns only the first hour value but the expected result should be between total of start calc and end cal value
time period Cal stat Time Range Expected Result
6:37:02 AM 1 start calc 6:37:02 AM 4
6:37:03 AM 1 no action 0
6:37:04 AM 2 End Calc 6:37:04 AM
6:37:06 AM 1 Start Calc 6:37:06 AM 6
6:37:07 AM 1 no action 0
6:37:08 AM 2 no action 0
6:37:10 AM 1 no action 0
6:37:11 AM 1 End Calc 6:37:11 AM
6:37:12 AM 2 Start Calc 6:37:12 AM 3
6:37:14 AM 1 End Calc 6:37:14 AM
6:37:15 AM 1 no action 0
6:37:16 AM 1 no action 0
6:37:17 AM 2 no action 0
6:37:19 AM 2 no action 0
I don't know about doing it with SUMIFS.
However, with INDEX(MATCH(…, you can construct a formula that will sum from the current row to the next "end Calc", and use an IF(… to only show results in the start calc rows.
E2: =IF(C2="start calc", SUM( INDEX(B2:$B$15,1): INDEX(B2:$B$15,MATCH(TRUE,C2:$C$15="end Calc",0))),"")
Fill the formula down as far as needed
The $15 row numbers in the formula can be changed to any row that is at least as large as your expected table, but be sure it remains an absolute address.
e.g: =IF(C2="start calc", SUM( INDEX(B2:$B$1500,1): INDEX(B2:$B$1500,MATCH(TRUE,C2:$C$1500="end Calc",0))),"")
I have a table in Excel that has the following columns:
My table
dm: Can be 0 or 1
gdr: Can be 0 or 1
smk: Can be 0 or 1
agemin: min age number
agemax: max age number
sbpmin: min sbp number
sbpmax: max sbp number
chlmin: min chl number
chlmax: max chl number
The table is big with all possible combinations.
What i need is a way to find the value in result based on the input of:
dm, gd, smk, age, sbp and chl. As i mention the first 3 can be a 0 or a 1 but the other 3 is a number that must be contain in the range given by the columns min and max.
Has anyone have a clue on how can i solve this?
Thanks,
Using the provided table and assuming the parameters for a lookup are in column M (as shown in the below picture), then the formula in cell M9 and copied right to get the result is:
=IFERROR(INDEX($J$2:$J$4,MATCH(1,INDEX((M2=$A$2:$A$4)*(M3=$B$2:$B$4)*(M4=$C$2:$C$4)*(M5>=$D$2:$D$4)*(M5<=$E$2:$E$4)*(M6>=$F$2:$F$4)*(M6<=$G$2:$G$4)*(M7>=$H$2:$H$4)*(M7<=$I$2:$I$4),),0)),"No matches found")
I have some data that looks like:
Day Result
1-Nov 1
0
1
2-Nov 1
3-Nov 0
0
4-Nov 1
There are other columns with data. I only have the date once as the data is displayed graphically in a time series.
Now I'd like to setup a summary table that aggregates each day. I cannot use sumifs because the date is only in the data once.
How could I write a calculation such that excel sees a2 has a value so sums b2,b3,...bi until ai has a value.
Preferably not vba, never learned it and want to do this in excel rather than R or Python.
EDIT:
I am specifically looking at how to do calculations on the result column grouped by each date. Blank cells should be considered the same date. So when excel sees 1-Nov it then does a calculation (i've said sum but any we can extend to) on 1,0,1 and then stops and a new calculation is done for Nov-2.
IMHO, instead of using a table like this:
Day Result
01/nov 1
0
1
02/nov 1
03/nov 0
0
04/nov 1
You should populate the "Day" column and use a pivot table to summarize the results.
I.e.:
Day Result
01/nov 1
01/nov 0
01/nov 1
02/nov 1
03/nov 0
03/nov 0
04/nov 1
And the pivot table:
All data are coming from one table. Date is based on the creation_date field of the table. I would like to create a report similar to the example below:
No. Prior to No. On
10/01/2015 10/1/2015 Total No.
a 5 1 6
b 10 3 13
c 1 0 1
I could not figure out how to display the combine results on the same "Report Page". I have to create 2 report pages one is for the prior date and the other is for the date "on".
Ok. If I understand your data correctly do this.
In your report create query with query items:
Type (a,b,c etc)
[No. Prior to 10/01/2015] with Aggregate Function = 'Total' and with expression
case when creation_date < to_date('10/01/2015', 'DD/MM/YYYY')
then 1 else 0 end
[No. On 10/1/2015] with Aggregate Function = 'Total' and expression
case when creation_date >= to_date('10/01/2015', 'DD/MM/YYYY')
then 1 else 0 end
[Total No.] with expression
[No. Prior to 10/01/2015] + [No. On 10/1/2015]
And create simple table with this values.
Or you can try to do it with crosstab.