If then add

billandrew

Well-known Member
Joined
Mar 9, 2014
Messages
743
Good afternoon all

Dividing the below, when the result is greater than 8 add .5 to the divisor and then divide the dividend by the new divisor.

[TABLE="width: 252"]
<colgroup><col width="70" style="width:53pt"> <col width="86" style="width:65pt"> <col width="96" style="width:72pt"> </colgroup><tbody>[TR]
[TD="width: 70, align: right"]70.25[/TD]
[TD="width: 86, align: right"]8.2[/TD]
[TD="width: 96, align: right"]8.57[/TD]
[/TR]
[TR]
[TD="align: right"]65.41[/TD]
[TD="align: right"]5.25[/TD]
[TD="align: right"]12.46[/TD]
[/TR]
[TR]
[TD="align: right"]20.35[/TD]
[TD="align: right"]2.5[/TD]
[TD="align: right"]8.14[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Lilke this?


Book1
ABC
170.258.28.07
265.415.2511.38
320.352.56.78
Sheet1
Cell Formulas
RangeFormula
C1=IF(A1/B1>8,A1/(B1+0.5),A1/B1)


WBD
 
Upvote 0
That did what I asked.

However, in the second row example , is there a way to add whatever is needed to return 8. Similar to the goal seek function.

Thank You
 
Upvote 0

Book1
ABCD
170.258.27.635879.2
265.415.257.9284858.25
320.352.56.7833333
Sheet1
Cell Formulas
RangeFormula
C1=IF(A1/B1>8,A1/(B1+ROUNDUP((A1/8-B1)/0.5,0)*0.5),A1/B1)
D1=A1/C1


Showing results and actual divisor.

WBD
 
Upvote 0
Most likely did not explain correctly. I need the result to be 8 or less.

Th second row B2 would be 8.1762. Then when 65.41 is divided into this the result would be 8.
 
Upvote 0
But you can't get 8.1762 by incrementally adding 0.5 to the original value of 5.25!


Book1
ABCD
170.258.288.78125
265.415.2588.17625
320.352.582.54375
Sheet1
Cell Formulas
RangeFormula
C1=IF(A1/B1>8,8,A1/B1)
D1=A1/C1


WBD
 
Upvote 0
I have no idea what your requirements are any more. I thought I gave the answer in post #4 so you'll have to explain to me what's wrong with that and exactly what you want to achieve.

WBD
 
Upvote 0
But column B has original values. If you want to change them then you need VBA. Post #6 has a solution that doesn't need VBA if you're happy to copy the values from column D to column B.

Man! I hate these shifting requirements! ;-)

WBD
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,249
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top