Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have data like the table below.
10 0 11 5 11 5 16 5
0 0 9 5 11 5 11 5
12 0 12 5 12 5 12 5
11 0 11 5 11 5 11 5
And I would like to ask you to know the logic in excel to count "0" value in every row and in column 1,3,5,7 only.
So that the answer will be 1 {1;0; 0; 0}
Thanks for your help.
A little shorter:
Updated to pick up on the empty cells issue
=SUMPRODUCT(--(MOD(COLUMN(A1:H4),2))* (A1:H4=0)*(LEN(A1:H4)>0))
;To get the exact output that you wrote, use this:
=CONCATENATE("[", COUNTIF(A:A, 0), ";", COUNTIF(C:C,0), ";", COUNTIF(E:E,0), ";", COUNTIF(G:G,0), "]" )
It uses the entire column as range. You can change that if you need.
=sum(countif(a1:a4,0),countif(c1:c4,0),countif(e1:e4,0),countif(g1:g4,0))
Obviously you may need to extend your ranges if the real data is more than 4 rows.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
how can i compare two values and rank them in excel
the largest value should be 1 and smallest be last
Category amount rank
abc 300 1
abc 6 3
abc 34 2
xyz 50 2
xyz 568 1
xyz 1 3
I tried this by my own COUNTIFS($A:$A,$A2,$B:$B,">"&$B2)+COUNTIFS($A$2:$A2,$A2,$B$2:$B2,$B2)
its working
but I want it in more simpler way.
Try this:
=SUM((B2<=$B$2:$B$15)*1*(A2=$A$2:$A$15))
This is an array formula so commit by Ctrl+Shift+Enter
Assuming your data starts in cell A2 you can use
{=MATCH(B2,LARGE(IF($A$2:$A$7=A2,$B$2:$B$7),ROW(INDIRECT("1:"&COUNTIF($A$2:$A$7,A2)))),0)}
This is an array formula, so enter using CTRL + SHIFT + ENTER.
Change $A$2:$A$7 and $B$2:$B$7 to your data range.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have an excel sheet with columns A and B populated with numbers, a la:
1 12
13 20
21 30
31 35
This is just as an example, in reality A and B are columns of length 50ish.
In this example, I have another column with values in it between 1 and 30. I want to write a function that returns which range it is between. Perhaps a 1 if it is between the first range (1-12) 2 between the second (13-20) etc.
This is the way the data was presented to me, if it needs to be re-arranged so be it.
Does anyone know any functions that would be useful to solve this problem? I have read that nested if statements are limited to 7 "if's" so I would need to write out a bunch of them.
Thanks folks.
As #Tim has said, =MATCH looks most suitable, without its optional third parameter, so that it “finds the largest value that is less than or equal to lookup_value.” Hence the upper bounds (right-hand column in your question) are not required for this formula. The numbers returned are the relative positions of the ‘match’ in the selected array. If your “another column with values in it between 1 and 30” is say C and starts in Row2 then =MATCH(C2,A:A) copied down is a generalisation that will only return 1, 2, 3 if the population of A:B starts in Row1. In other words, if the 1 in A is say in Row3 then I’d recommend:
=MATCH(C2,A$3:A$6)
copied down to suit.
The last number in A (ie 31) can be anything as long as it is more than the upper bound of your “between 1 and 30”.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have a table:
Group 0 Group 1 Group 2
Day 1 10 12 9
Day 2 7 5 14
Day 3 12 11 3
...
I want to calculate running total for Groups 1 and 2 as % of running total of Group 0:
Group 0 Group 1 Group 2
Day 1 100% 120% 90%
Day 2 100% 100% 135%
Day 3 100% 97% 90%
...
A pivot table allows to "Show Value As" either running total or % of, but I can't figure out how to have both.
I doubt possible even in Excel 2010 (which I don't have) but the values you show are achievable with the PivotTable showing running totals and (if Day1 is in E4) =F4/$F4 alongside and copied down and across to suit.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Improve this question
I am making a cost calculator and what I want is a cell to display a converted value based upon a range of values. For example: if the value is > 100mb I want a cell to display $25.00 and if > 200mb than the cell to display $50.00.
Assuming you have your mb value in A1 cell how about something like
=FLOOR((A1 - 1) / 100, 1) * 25
It will give you (exactly as in your requirements > 100)
A1 B1
--------
99 0
100 0
101 25
200 25
201 50
=FLOOR(A1 / 100, 1) * 25
It will give you (>= 100)
A1 B1
--------
99 0
100 25
101 25
200 50
201 50
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have an excel file with several columns, which looks as follows
ID1 ID2 ID3
1 2 3
6 5 4
7 8 9
I would like to add one extra column, which stores the largest value for row. How to do that in Excel?
Assuming that the data you have is in Columns A through C and rows 1 through 4, put the following formula in column D, and copy it down as far as necessary:
=max(A2:C2)
In the extra column (say D1) put : =max(A1:C1)
You can paste it downward.