How to convert the data following into range on excel? - excel

I have data like following:
If I want it to convert it into specific ranges like following:
How should I do it on excel?

As Foxfire And Burns And Burns has mentioned, it is best to use a PIVOT TABLES and then Group it by intervals of 50. Using Pivot Tables and then Group & Ungroup is pretty easy and highly suggested by all excel experts in this community.
However if you are looking to use a formula to create that range (RAFFLE TICKET) that's how its known, then you may try the formula mentioned below,
Formula used in cell A2
=(ROWS($A$2:A2)-1)*50&"-"&ROWS($A$2:A2)*50
And Fill Down!
For those using Excel 2021 & O365, may try this one as well
=SEQUENCE(11,,0,50)&"-"&SEQUENCE(11,,50,50)
Next to get the total counts you can use SUMPRODUCT FUNCTION, which creates an array of TRUE's & FALSE's & multiplies the same with the corresponding ranges accordingly, so the formula used in cell B2
=SUMPRODUCT(($E$2:$E$16>=--LEFT(A2,FIND("-",A2)-1))*($E$2:$E$16<=--RIGHT(A2,LEN(A2)-FIND("-",A2)))*$F$2:$F$16)
And Fill Down!

I suggest you to create the Dummy column (C column) which will contain the limits of your ranges. And then you will fill values into the D column thanks to this formula :
=C2 & "-" & C3
So the first value Total Count column can be filled with (in column E) :
=SUMIF(A$2:A$16;"<"& C3;B$2:B$16)-SUMIF(A$2:A$16;"<"&C2;B$2:B$16)
and then you can extend the formula through the other cells of the column.
This SUMIF() formula calculates values for range <50 minus values for range <0 (for Range 0-50). For Range 50-100, this formula will calculate the sum for range <100 minus sum for range <50, and so on..
The
Remark : Here the limits of the range are not considered for example if Valeur =50 the formula in Range column doen't count it. If you want to consider them in account, you can modify the values of the Dummy column to 0; 49.999999; or 50.000001 (left for you as an exercice :) ).

I would advise you to create a helper column, using a formula like =ROUNDDOWN(A1,0).
Once you have this (let's say in column "C"), you can sum your values using the basic =SUMIF() function, something like:
=SUMIF(C$1:C$8,3,B$1:B$8)
(This will sum the values of the cells from B1 to B8, in case the corresponding values in column "C" are equal to 3, which means that the values in column "A" are between 150 and 199.99....

Related

use dynamic range in countif formula

I have this sheet with data:
the search range (row 3) is filled until column AM and the count range (row 4 and lower) is only filled until column R (more columns will be filled in time)
I need to have a formula to use in my count if formula to find the last filled column.
So in this case the the search range for the countif formula has to be:
=countif(C3:R3;C4:R4)
but when column S is filled, the formula should automatically use column S instead of R. etc.
the formula is used to calculate an average of the scores/percentage for a certain skill (e.g. optellen+aftrekken, tafels, tijd). So just counting the arguments in row 4 or lower is not enough. It also has to count how many times the given skill is found in the applying range (Column C to R, C to S etc).
I have a combinated formula to have the complete first parameter for the countif formula:
="'invoer optie2 (2)'!C$3:"&(ADRES(3;AANTALARG('invoer optie2 (2)'!4:4)+1;2;1))
(the formula is in dutch).
the result is this:
'invoer optie2 (2)'!C$3:R$3
This is the part I need for my countif formula. I keep struggling on how to use this in the countif formula so it uses it a the search range.
How can I convert this "string" to the range in the countif formula?
Do not use ADDRESS and INDIRECT as they are Volatile.
Instead use INDEX:
=COUNTIFS('invoer optie2 (2)'!C$3:INDEX('invoer optie2 (2)'!$3:$3,MATCH(1E+99,'invoer optie2 (2)'!4:4)),"WhatYouWant")

Array formula to sum dynamic range

i have data that looks like
this.
I want to insert an array formula, which will sum specific range based on user's choice. If the user chose for example "3", i want an array formula to Sum absolute value of 3 last columns (D,E,F) for each row (rows are also dynamic - there could be 10,50 or more rows). Last column is always in the same place, the starting point change. How can i do that?
Assuming your data starts in cell A1 and the number of columns chosen is in H6 and you are using dynamic array excel then try this formula:
=SUM(ABS(INDEX(A1#,SEQUENCE(ROWS(A1#),1),SEQUENCE(1,COLUMNS(A1#)-H6+1,H6))))
To enter into cell Z9 using vba if nCols contains the number of columns try this:
Range("Z9").formula2="=SUM(ABS(INDEX(A1#,SEQUENCE(ROWS(A1#),1),SEQUENCE(1,COLUMNS(A1#)-" & nCols & "+1," & nCols & "))))"

Which formula should I use in order to get total number and minutes of malfunction?

Using only "vlookup" does not work because there are a bunch of malfunctioning minutes & total numbers of it. So as I know I should combine "vlookup" with "sum" or I am wrong? please support me on this query.
You can use Countif() to count with conditions and Sumif() to sum up numbers that fulfill a condition.
In cell K10 (count System No malfunctions)
=Countif(A:A,K9)
... in words: count the rows in column A whose text is equal to that in cell K9.
In K11 you can conditionally sum with this formula:
=Sumif(A:A,K9,C:C)
... in words: for all the rows in column A whose text is equal to that in cell K9, sum the values in column C.
Copy the two formulas from K10 and K11, paste them into K15 and K16 and change the reference from A:A to D:D to look at the code column instead of the system number.

excel SUMIFS only on same date

I'm trying to create a formula in column K which sums all cells that apply , in column J, only when the following conditions are true:
dates are the same in column A
AND client name is the same in column B
For example, in cell K2, I want the sum of J2+J3+J4 because A2=A3=A4 and B2=B3=B4.
K5=J5 only, because there are no other dates with the same client name.
K6=J6+J7 because A6=A7 and B6=B7.
What kind of formula would I use for this? I can't figure out how to do it with a SUMIFS.
I would try using a pivot table with:
The names as row values
The dates as the column values
And funds received using SUM in the values column
Edit
Based on #pnuts comments here is how to get the values in column K. Put this in K2 and drag down.
=IF(OR(COUNTIFS($B$1:B3, B3) = 1, B3 = ""), SUMIFS($J$2:J2, $A$2:A2, A2, $B$2:B2, B2), "")
This formula will give blank values until the formula finds a new client on a new date. However, I still think using pivot table is a better solution.
However, I still find the pivot table
In cell K2 put following formula:
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1,SUMIFS($J$2:$J$10,$A$2:$A$10,A2,$B$2:$B$10,B2),"")
Adjust row 10 value. It will be last row of your actual data.
Copy down as much you need.
EDIT
Uploaded file shows the cause behind formula not working correctly for you. It turned out to be whitespace characters in column B (names) data e.g.
Cell B3: "Moe John" has a trailing space.
Cell B10: Same case with "Doe Jane"
If you want to use above posted formula then all names shall be corrected. Or alternatively to deal with spaces you can adopt below approach.
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,"*"&TRIM(B2)&"*")=1,SUMIFS($J$2:$J$28,$A$2:$A$28,A2,$B$2:$B$28,B2),"")
Notice the change in COUNTIFS formula where B2 is now replaced with "*"&TRIM(B2)&"*".
Even such formula will take a beating if you have uneven whitespace characters in between your data. I'd suggest normalizing it as much as possible.

Range row number reference from another cell in Excel

Edited: So I made the question more complicated. If I would like to do a 'what if ' analysis which requires to be able to refer the last row to sum from another cell to the sumif formula. How can I do that?
Just drop the row numbers from your formula and use the entire columns:
=SUMIF(A:A,">4",B:B)
The beauty is that SUMIF will disregard non-nmeric rows anyway.
To sum up and stop at a certiain row, you can use SUMIFS with ROW:
=SUMIFS(B:B,A:A,">4",C:C,"<" & D2)
Where D2 holds the row number using the formula =ROW(<CELL>), i.e: =ROW(A2) in cell C2:

Resources