I want to multiply
the numbers from 0 to 4999 with 0.5
the numbers from 5000 to 9999 with 0.45
the numbers above 10000 with 0.4
and plot it in a simple 2D line chart.
I assumed that would be rather simple, but I struggle to find a feasible solution. Also is there a way to plot the chart in Excel without filling the values for 10000+ rows?
Thanks in advance!
For your multiplication problem, asusming your numbers to multiply are in column A and start in A1, input the following in B2 and drag down to get your multiplied number:
=IF(A1>=10000,A1*0.4,IF(A1<5000, A1*0.5,A1*0.45))
Regarding your plot question, it's hard to help with so little information.
Use vlookup and a simple multiply as so:
=A1*VLOOKUP(A1,$E$2:$F$4,2,1)
This means it is much easier to change the values used...
Related
I've the following matrix, and I need to get the hours of the minimum and maximum values from each block of ones.
In my first attempt, I've obtained the first 1 and the last one (8:30 and 17:00) using the minifs and maxifs formula.
Since I couldn't obtain 11:00 and 12:30, I changed my approach. I've created a help matrix with 48 columns that gives 0,1,2,3 or 4 in the positions that I want. See it:
However, doing this help matrix increases the file size a lot. I wish that I could get the middle hours by using just a formula. I don't want to use the help matrix.
Thanks in advance!
Put this in the first cell and drag across and down:
=INDEX($1:$1,AGGREGATE(15,7,COLUMN($B2:$AV2)/(($A2:$AU2=--(ISEVEN(COLUMN(A1))))*($B2:$AV2=--(ISODD(COLUMN(A1))))),INT((COLUMN(A1)-1)/2)+1)-ISEVEN(COLUMN(A1)))
3000 Rows of data and need a formula to be applied to calculate percentages in blocks of 4 rows.
I've tried dragging the formula down and playing around with Offeset function, but can't figure out a correct way for doing it.
THANKS EVERYONE FOR YOUR HELP, FOUND A SOLUTION! Looks like I should have mentioned that the counts were weighted so calculations were based off of the actual number not the rounded one displayed.
Use:
=M11/SUM(INDEX(M:M,INT((ROW(1:1)-1)/4)*4+11):INDEX(M:M,INT((ROW(1:1)-1)/4)*4+14))
Here is a solution not using INDIRECT:
=$M11/SUM(INDEX($M:$M,(ROUNDDOWN((ROW(1:1)-1)/4,0)*4)+11):INDEX($M:$M,(ROUNDDOWN((ROW(1:1)-1)/4,0)*4)+15))
This solution assumes that the values in the far left column will always be the same.
=IF(A1="B2",C1/SUM(INDIRECT("C"&ROW(A1)&":C"&ROW(A1)+3)),IF(A1="M3",C1/SUM(INDIRECT("C"&ROW(A1)-1&":C"&ROW(A1)+2)),IF(A1="T2",C1/SUM(INDIRECT("C"&ROW(A1)-2&":C"&ROW(A1)+1)),C1/SUM(INDIRECT("C"&ROW(A1)-3&":C"&ROW(A1))))))
It's long but gives these results.
Okay so as you can see each column has a value of 1-3. Currently there's just a basic formula at the end that works out the percentage by adding whats there and then dividing by the total possible if every column was 3 and then multiplying by 100.
My problem is I would like to put 'n/a' down as a result sometimes where a number value/score wasn't relevant. But when it comes to calculating the percentage it would be marked lower since it would be three less than the total possible.
So I assume there a few different ways I could tackle this problem, either by a formula that calculates the possible total based upon only the cells that have a numerical value or a formula which reads n/a as the value 3. But I can't seem to find something that works.
Please help, thanks.
You can do this:
The countif() counts the n/a and multiplies by 3 to be subtracted from the 24.
Okay I think I figured this out and the solution was far more simple that I thought it would be.
Originally the Score as % formula was =SUM(T14/24*100) 24 being the total is all cells were 3.
So what I've done is add a new column called possible total with the formula =COUNT(K14:R14)*3 As the count function only counts cells that have a numerical value, thus will ignore any cells with n/a and since 3 is the maximum value that can be entered into the cell I've multiplied the count by 3.
Then it was a simple case of changing the score formula to =SUM(T14/S14*100) where the S column will be the new possible total.
I have a set of data, composed of positive and negative numbers. For simplicity let’s say the data looks like this:
I would like to sort the data by only positive and negative numbers for “only top 3 customers”. So the report would look like this:
I have been experimenting with formulas like this, but this formula doesn't help me achieving the results.
=IFERROR(LARGE(IF(A2:A13>0,A2:A13,""),ROW()),"")
I have data for more than 3000 lines and need only top 20-30 positive numbers and Top 20-30 negative numbers.
Any help will be greatly appreciated.
Looking forward for the positive response.
Thanks,
Ganesh
You are overcomplicating your formulas above - but you are on the right track.
Put this formula in row 2 of the Positive column, and drag down for as many items as you want to highlight:
=IFERROR(MAX(0,LARGE(A:A,ROW()-1)),"")
Note that I have used ROW()-1, instead of ROW(), because we are starting at row 2, and therefore row 2 should contain the largest amount, not the 2nd largest amount. I have also forced it to show a 0 if it would otherwise show a negative number [ie: if you want the largest 5 numbers, and the 5th largest is a negative #].
The formula for showing the smallest negative formulas is nearly identical:
=IFERROR(MIN(0,SMALL(A:A,ROW()-1)),"")
this can easily be achieved by using LARGE(range,k) and SMALL(range,k) formulas which give you the k-th largest or the k-th smallest number in a range, respectively.
you can use them in combination with the ROW([range]) function which gives you the row number of the desired range. if you use ROW(A1) as the k for the aforementioned functions, then dragging the formulas down will yield ROW(A2), ROW(A3) and so on, which for each row will give you the desired k value.
so the formula will look like this:
top positive numbers:
=LARGE($A$2:$A$13,ROW(A1))
bottom negative numbers:
=SMALL($A$2:$A$13,ROW(A1))
then you just need to drag the formula down to the nearby cells and you will get your result.
there's one problem with this approach - if you want to get 20 top positive numbers but only have, say, 10 positive numbers in the range, the formula will give you 20 top numbers regardless if they're positive or negative. however, i believe in your case, this is the easiest and fastest solution and this shouldn't be a big deal.
I have a list of 1s and 0s in excel ranging from A1:A74 and I am looking to work out what the current streak of 1's is.
For example I have:
1
0
1
1
1
I would want the streak to give me 3.
I have tried the following formula which seems to work for smaller ranges, but for my full set it gives me the wrong amount:
=COUNTA(A1:A73)-MATCH(1,INDEX(1/(A1:A73=0),0))
Any help would be much appreciated.
edit - I believe i've fixed the formula above to work:
=COUNTA(S$2:S$74)-MATCH(2, 1/(S2:S$74=0), 1)
This is basically finding the last position of 0 and minusing this from the overall number of rows which have values.
As Above, I've figured out the answer to my own question by just simplifying exactly what I needed to do and it became very obvious:
=COUNTA(S$2:S$74)-MATCH(2, 1/(S2:S$74=0), 1)
This is basically finding the last position of 0 and minusing this from the overall number of rows which have values.
If you can afford a helper column then there is another very easy way to do this.
Enter this formula in B2 (or any other cell in row 2(Assuming you are using a header)) and copy it down.
=IF(AND(A2=0,A3=0),B1+1,1)
You can then pick up the maximum value from this range and if required hide the column.