If less than, divide by...

Bedford

Active Member
Joined
Feb 3, 2015
Messages
316
Office Version
  1. 365
Platform
  1. MacOS
Attempting a calculation. A cell (B13) results in a whole number based on a formula. That resulting whole number is dynamic, example; 2179. Then 2179-180=1999, 180 is static. The result 1999, needs to be divided by 2 if <1350, divided by 3 if > 1351 but < 1650, divided by 4 if > 1651 but < 2000, divided by 5 if > 2001 but < 2500, divided by 6 if > 2501 but < 3000.
I'm hoping this can be done in a formula, and that someone can assist.
Thank you in advance.
 
Hi,

No problem, there are different ways to "trap" the error, you can use IFERROR, or test B13 for a Number, this is using IFERROR:

Book3.xlsx
BC
13Enter Value
14
15 
Sheet833
Cell Formulas
RangeFormula
C15C15=IFERROR(IF(LOOKUP($B13-180,{0,1351,1651,2001,2501},{2,3,4,5,6})>=COLUMNS($B15:C15),($B13-180)/LOOKUP($B13-180,{0,1351,1651,2001,2501},{2,3,4,5,6}),""),"")
 
Upvote 0
Solution

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi,

No problem, there are different ways to "trap" the error, you can use IFERROR, or test B13 for a Number, this is using IFERROR:

Book3.xlsx
BC
13Enter Value
14
15 
Sheet833
Cell Formulas
RangeFormula
C15C15=IFERROR(IF(LOOKUP($B13-180,{0,1351,1651,2001,2501},{2,3,4,5,6})>=COLUMNS($B15:C15),($B13-180)/LOOKUP($B13-180,{0,1351,1651,2001,2501},{2,3,4,5,6}),""),"")
You did it again, a simple solution, but effective, thank you again!
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,559
Members
448,970
Latest member
kennimack

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