If formula between ranges and with several possible tags - excel

Would anybody happen to know if possible to build the following formula?
(Dont know if its too complex to actually do through an IF function)
If "good" and number in second column is = to 1,4 or below then give X percentage discount. If between 1,41 and 1,47 then give X percentage discount. If between 1,48 and 1,57 then give X percentage. If equal to 1,58 or above then give X
If "Fair" and number in second column is = to 1,4 or below then give X percentage discount. If between 1,41 and 1,47 then give X percentage discount. If between 1,48 and 1,57 then give X percentage. If equal to 1,58 or above then give X
If "Attention" and number in second column is = to 1,4 or below then give X percentage discount. If between 1,41 and 1,47 then give X percentage discount. If between 1,48 and 1,57 then give X percentage. If equal to 1,58 or above then give X
If "Clearance" then give 80% discount

Make a table that has the values:
Then use an INDEX/MATCH/MATCH formula:
=INDEX(G:K,MATCH(A2,G:G,0),MATCH(B2,$G$1:$K$1))

Based on your previous question, try the below formula
=IF(C2<=1.4,IF(B2="Good",0.1,IF(B2="Fair",0.2,IF(B2="Attention",0.3,0.8))),
IF(AND(C2>=1.41,C2<=1.47),IF(B2="Good",0.12,IF(B2="Fair",0.22,IF(B2="Attention",0.32,0.8))),
IF(AND(C2>=1.48,C2<=1.57),IF(B2="Good",0.15,IF(B2="Fair",0.25,IF(B2="Attention",0.35,0.8))),
IF(B2="Good",0.18,IF(B2="Fair",0.28,IF(B2="Attention",0.38,0.8))))))
Format Column D as Percentage. Percentages assigned in the formula are based on the corresponding conditions listed in the image below.

Related

Excel: SUMPRODUCT with percentages

I use the following formula to calculate the SUMPRODUCT of the values in a column with the condition that there is a match between B2:B6 and A1:A3 (shoutout to user:8162520).
=SUMPRODUCT(($B$1:$B$6=$A$9)*(G2:G6))
Now however I would like to subtract to that result the percentage in C1 and/or D1, and "give it" to one of the other blue numbers, again with the condition that there is a match between C2:C6 or D2:D6 and A7:A9.
So for example in G7 the result for "1" should be 50% of 10 + 75% of 5, because "2" takes 50% of 10(G2) and "3" takes 25% of 5(G5).
The point is to create an overview of how many hours employees (1,2,3) have to spend spend on project B2:B6 for each week (E,F,G), and what happens if other employees take a certain percentage of the workload (C,D). What is the most efficient way to do this?
The numbers in A, B,C, D are reference numbers, they should not be part of the calculation. Maybe it's clearer if I use letters. See also the right results for E7:G7. The outcome must be the sum of the values in each column (workload) minus the percentage in C and D IF there is someone sharing the workload:
So deducting the percentage in C1:D1, presumably where there is no workload the result should be zero?
=SUMPRODUCT(($B$2:$B$6=$A7)*($C$2:$D$6<>"")*(1-$C$1:$D$1)*G$2:G$6)

Excel: Rounding up Nearest value

Click HERE for excel file.
In the Excel file based on Column B values I am finding nearest up offer price range which is in Row number 2 in Grey Color, Offer price per sqm is incremental by $50. As you can see in Yellow color values are multiplied by offer price * Land sqm.
3rd property nearest offer price range is $750. As you can see I am using multiple columns from C, D, E, F.
Instead what I want is get the "Offer Price per/sqm" value in column "G". How to do that.?
Though you are not pretty clear about the output you want, I think you want to round the offer price to nearest 50. If so, use this in G3 (and copy down)
=MROUND(A3/B3, 50)
this will return $700 as nearest offer price. However, if you want to round only upwards i.e. towards $750, use this (and copy down)
=CEILING(A3/B3, 50)
If you want either of these formulae to return values between 650 and 800 only use either of these
=IF(AND(CEILING(A3/B3, 50)>=650, CEILING(A3/B3, 50) <=800), CEILING(A3/B3, 50), "NA")
Based on your comment, perhaps you need this?
=IF(AND(CEILING(A3/B3, 50)>=650, CEILING(A3/B3, 50) <=800), CEILING(A3/B3, 50)*B3, "NA")
I wonder if this is what you want.
[G3] =B3*INDEX($C$2:$F$2,1,MATCH("x",C3:F3,0))
You would mark the appropriate column with an "x" and the formula would multiply the price in row 2 of the first marked column with the number of sqm.
To simulate your example, an "x" would be placed inE3 and F3. The formula in G3 would ignore the F3 and show the price based on E2. If you add an "x" in D3 the lower price will be shown in G3.

How to achieve equal Sum Values horizontally and vertically in Excel

I'm working on this for a week now and still could not get the result I want. What I want is to have an equal result between the horizontal total and vertical total when summing up every columns in excel. Please consider this worksheet.
Every TSalary values in each row is equal to each values in its row in Gross Pay Columns. The same thing also in TDeductions with the columns in Deductions. However, after summing up each row and getting its overall total in AD13 & AE13, I am not getting the same value with the total when summing up every columns in gross pay and deductions.
In column AE you seem to have rounded each value to the nearer cent. In cell N13 you have summed the unrounded values.
The 4 half-cents (in column N) that have thus been rounded to a full cent cause your total to be 2 cents higher than the total of the unrounded amounts.
You need to be consistent when applying roundings if you wish your totals to be consistent.

Median Selling Price Excel Table

I have a spreadsheet with different products, listing units and retail value sold like the example below
Product Units Value
A 10 100
B 15 80
C 30 560
I'd like to compare the Average Selling Price with the Median Selling price, so I am looking for a quick formula to accurately calculate the median.
The median function requires the entire series, so for Product A above I would need 10 instances of 10 etc. How can I calculate the Median quickly considering the condensed form of my data?
Without writing your own VBA function to do this there are a couple of approaches that can be taken.
The first expands the data from its compressed frequency count format to generate the full set of observations. This can be done manually or formulaically. On the assumption the latter is required, it can be achieved using a few columns.
All the blue cells are formulae.
Column Eis simply the cumulative of column B and F is an adjusted version of this. Column H is just the values 1 to 55, the total number of observations given by cell L2. Column I uses the MATCH() with its final argument as 1 to match each observation in H against the adjusted cumulative in F. Column J uses the INDEX() function to generate the value of the observation. (Observations 1-10 have value 100, 11-25 have value 80 and 26-55 have value 560 in this example). The MEDIAN() function is used in cell M2 with column J as its argument.
This approach can be refined to take account of varying numbers of products and data points through the use of the OFFSET function to control the range arguments of the MATCH(), INDEX() and MEDIAN functions. And, of course, adjacent cells in columns I and J could be combined using a single formula - I've shown them separately for ease of explanation.
The second approach involves sorting the data by value (so in this case the data rows would become Product B in row 2, product A in row 3 and product C left as-is in row 4). It is then a case of identifying the middle observation number (if the number of observations is odd) or the middle pair of observation numbers (if the number of observations is even) and then determining the value(s) corresponding to this/these middle observation(s). In this approach the adjusted cumulative in column F is still used but rather than explicitly calculating the values in column I and J for every observation it can now be restricted to just the middle observation(s).
I think there is no way around compromises. Either using big amounts of helper cells or having the table sorted by the values.
Helper cells:
Formula in F4:AS6:
=IF(COLUMN()<COLUMN($F$4)+$B4,$C4,"end")
Formula in D2:
=MEDIAN(F4:AS6)
Sorted:
Formula in F4 downwards:
=SUM($B$3:B3)+1
Formula in D2:
=SUM(LOOKUP(INT(SUM(B4:B6)/2+{0.5,1}),F4:F6,C4:C6))/2

Excel: What to multiply by to get a specific result

How do I make a formula that calculates what to multiply by in order to get a specific result?
Let's say I want to bet 100 at odds 2. This gives me 200, with a profit of 100.
What if the odds is 3 (or any other number). How much would I have to be to keep a profit of 100?
It sounds really simple, but I just can't figure it out...
Given k (e.g. 2 or 3) you want to solve the equation kx - x = 100. But this is just (k-1)x = 100 so x = 100/(k-1). If the odds (k) are in cell A1 and the target profit (e.g. 100) is in cell A2 then in cell A3 you can put the formula =A2/(A1-1). Obviously, you don't have to use those specific cells.

Resources