Generate Column of raw data based on frequency table in Excel - excel

I have a column of numbers and a second column of numbers. The second column of numbers contains the frequency of the numbers in the left column.
I want to create a third column of numbers that has the raw data.
Example:
A B
1 5
3 2
4 4
Column C would look like:
C
1
1
1
1
1
3
3
4
4
4
4
How can I do that in Excel? Thanks!

Based on data in A1:B3, in C1, array formula**:
=IF(ROWS(A$1:A1)>SUM(B$1:B$3),"",INDEX(A$1:A$3,MATCH(TRUE,MMULT(0+(ROW(A$1:A$3)>=TRANSPOSE(ROW(A$1:A$3))),B$1:B$3)>=ROWS(A$1:A1),0)))
and copied down until you start to get blanks for the results.
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).

Related

Flag rows contributing to the sum criteria

I have two columns like this:
Name Value
A 1
A 4
B 3
B 2
B 5
C 6
C 8
C 10
C 4
I am doing sumif based on Names but I have a criteria to full fill. Looking from the least values in a name group whenever my sum reaches lets say 5 I want those rows to have a flag 1 or else 0. In this example it should be:
Name Value Flag
A 1 1
A 4 1
B 3 1
B 2 1
B 5 0
C 6 0
C 8 0
C 10 0
C 4 1
The data is random and not in any order and file is dynamic so can not work around by just putting it in decreasing order. I do not have any idea about offset. Could it be done without using offset and only by regular ifs, sumifs etc. Thanks a tonn!
Perhaps this can be simplified somewhat, though, assuming you put your chosen threshold (e.g. 5) in J1 and that, as implied by your reply to my last comment, no one value for a given Name occurs more than once, then, in C2, array formula**:
=IFERROR(GESTEP(MATCH(1,0/(MMULT(0+(ROW(INDEX(A:A,1):INDEX(A:A,COUNTIF(A$2:A$10,A2)))>=TRANSPOSE(ROW(INDEX(A:A,1):INDEX(A:A,COUNTIF(A$2:A$10,A2))))),SMALL(IF(A$2:A$10=A2,B$2:B$10),ROW(INDEX(A:A,1):INDEX(A:A,COUNTIF(A$2:A$10,A2)))))<=J$1)),MATCH(B2,SMALL(IF(A$2:A$10=A2,B$2:B$10),ROW(INDEX(A:A,1):INDEX(A:A,COUNTIF(A$2:A$10,A2)))))),0)
Copy down as required.
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
In column C add
=IF($B10<5,1,0)
Im assuming the last value is meant to be 0 as the values in C have already passed 5? Try this one.
=IF(SUM(A2:INDEX($B$2:$B$10,MATCH(A2,$A$2:$A$10,0)))<6,1,0)

Excel MATCH to sum of two cell values

I have a table of data that include a name column and two numeric columns. Example:
A B C
Fred 4 2
Sam 3 6
George 1 7
I'm wanting to retrieve the name in column A for the largest sum of columns B and C. In the example above, I would want "Sam" because 3+6 is greater than any of the other sums.
I know I could create a hidden column (D) that's filed with
=SUM(B2,C2)
and do something like this:
=INDEX(A:A,MATCH(MAX(D:D),D:D,0))
but I'd rather avoid the hidden column, if possible. Is there a way to perform an index-match based on the sum of two cells?
Use the array formula:
=INDEX(A:A,MATCH(MAX((B:B)+(C:C)),(B:B)+(C:C),0))
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.
(Note the appearance of braces in the formula bar)

Excel, How to write a formula that fits these criteria

A B C D E F G
1 Date: 9/15/2016 9/16/2016 9/17/2016 9/18/2016 9/19/2016 9/20/2016
2 Points: 0.5 1 - - 0.5 1
The above data is on tab 1 of an excel spread sheet
And below are fields on tab 2 of the same excel spread sheet:
A B
1 DATE: Points
2
3
4
5
I am trying to write a formula that will go through the dates and points rows on tab 1 and when it finds a date with a corresponding point it will populate that date in tab 2 under the Date column. Simple enough right? Well here's where I'm running into problems, I need a formula to include the following criteria:
1) If the date does not have a corresponding point in the second row on tab 1 it will skip it and move on to the next date to validate it and so on
*note- I also need the Points column on tab 2 to populate with the corresponding date, but I believe a simple HLOOKUP formula will work just fine
2) I would like to have the formula to where it can be duplicated on tab 2 cells A3,A4,A5 and so on, but as an example: if A2 has date of 9/15/2016, when the formula in A3 is checking for dates with corresponding points in tab 1, it will skip the date in tab 2 located in A2 since it's already been used
Below is a picture of the above data in case it didn't come out right, and thanks for the help!!
Use this array formula:
=IFERROR(INDEX('Tab1'!$B$1:$G$1,MATCH(1,('Tab1'!$B$2:$G$2<>"")*(COUNTIF($A$1:A1,'Tab1'!$B$1:$G$1)=0),0)),"")
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter when exiting edit mode instead of Enter. If done correctly then Excel will put {} around the formula.
This will create a list as it is dragged/copied done. The list will be in the same order as the list on tab1.

Sumproduct matching values in excel

I have two excel tables:
A B C D E
1 John 10 Mark 2
2 Tommy 20 Tommy 3
3 Jane 15 John 4
4 Kate 2
5 Jane 1
Is there a function to sumproduct values in colum B with those values in column E which match by name, i.e. 10*4 + 20*3 + 15*1 ?
You can use sumif for this and just sum up the results when you are done:
=B1 * sumif(D:D, A1, E:E)
Copy that down your sheet, and then add up the totals.
If you don't want a ton of formulas hanging out on your sheet, you could convert this to a CSE/Array formula:
=SUM($B$1:$B$3*SUMIF(D:D, $A$1:$A$3,E:E ))
Just enter that in and hit Ctrl+Shift+Enter to enter it. It will get curly braces around it, which means it's an Array formula.
Since you asked about sumproduct, we could use SUMPRODUCT
=SUMPRODUCT(($A$1:$A$5=A1)*$B$1:$B$5)*SUMPRODUCT(($D$1:$D$5=A1)*$E$1:$E$5)
Now that is assuming there are no repeats (all names are unique). In the event that names are not unique you will have those numbers added together then multiplied.
After you apply that to a column and copied down appropriately, lets say F1 to F3, in F5 you could get your final answer using:
=SUM(F1:F3)

Microsoft Excel 2010: Help making a Formula to up Values by a repeating pattern

I have a Spreadsheet, and inside this sheet contains a column with numbers, I want to make a formula that will go down that Column and do basically this.. Values: 1 will be 9.50. 2 will be 9.75. 3 will be 10.00. Ect going up to Value of 100? Is that possible for a Formula? I keep playing with it but can't really seem to get it down. Any help would be appreciated.
Column A: 1
1
1
1
1
2
2
2
2
2
2
2
2
2
3
3
3
3
There is not a set amount to how many values are in there.
this should do it supposing that column A has these values 1, 2 ...etc that your computing will be based on
=MIN(9.25+A1*0.25;100)*COUNT(A1)
In A2, enter the formula
=A1 + (9.5-A1)
then in the cell just below it (A3), enter
=A2+0.25
Assuming A1 is the top left. Copy the formula in A3, select the next 399 cells and paste. Then select A2 - A364 and copy. Then select B2 -xx364 and paste. xx is the last column with data. If you want, set the height of your first column to 0 to hide it.
=(A1-1)*0.25+9.5 where A1 contains any number you want

Resources