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.
 
Perhaps it would be better if @Bedford could show some examples with actual values and expected results in order to eliminate any more potential confusion from convoluted descriptions.
I hope this makes sense?
 

Attachments

  • Screen Shot 2021-03-07 at 5.50.57 PM.jpg
    Screen Shot 2021-03-07 at 5.50.57 PM.jpg
    213.6 KB · Views: 6
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
The description in your post makes sense now that I've seen the screen capture.
Enter this into C15 and fill down.
Excel Formula:
=IF(ROWS($C$15:$C15)<=MATCH(B13-180,{0,1351,1651,2001,2501}),$C$13,"")
 
Upvote 0
The description in your post makes sense now that I've seen the screen capture.
Enter this into C15 and fill down.
Excel Formula:
=IF(ROWS($C$15:$C15)<=MATCH(B13-180,{0,1351,1651,2001,2501}),$C$13,"")
I entered the formula in C15, but the result is zero. Is it meant to be an array?
 

Attachments

  • Screen Shot 2021-03-07 at 6.06.06 PM.jpg
    Screen Shot 2021-03-07 at 6.06.06 PM.jpg
    248.4 KB · Views: 4
Upvote 0
I hope this makes sense?
The description in your post makes sense now that I've seen the screen capture.

Actually, it does not, in your Post #7, you wanted to use C15:C19, but the screenshot you show in Post #11 appears that you're using D15:H15.
And Now, your post #13 appears your may have "Merged" cells...

This works in C15 dragged across to G15, without merged cells:

Book3.xlsx
BCDEFG
131148
14
15484    
Sheet833
Cell Formulas
RangeFormula
C15:G15C15=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}),"")


If this works for you, we'll see if we can shorten the formula a bit.
 
Upvote 0
Actually, it does not, in your Post #7, you wanted to use C15:C19, but the screenshot you show in Post #11 appears that you're using D15:H15.
And Now, your post #13 appears your may have "Merged" cells...

This works in C15 dragged across to G15, without merged cells:

Book3.xlsx
BCDEFG
131148
14
15484    
Sheet833
Cell Formulas
RangeFormula
C15:G15C15=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}),"")


If this works for you, we'll see if we can shorten the formula a bit.
So true, added columns and it copied merged cells, sorry for the mess I've been working at this one for seems too long. That said, your formula works! I dragged across from C15 to H15, it added results in C15:E15, since it's calculating dividing B13 by 4, I'm hoping it will return results only in C15:F15, if dividing by 5, it should return results C15:G15, and likewise if dividing by only 2 results to C15:C16.
 

Attachments

  • Screen Shot 2021-03-07 at 6.34.49 PM.jpg
    Screen Shot 2021-03-07 at 6.34.49 PM.jpg
    216.2 KB · Views: 2
Upvote 0
I've tested my formula using different values in B13 and it's working according to your description, you should test with various possible scenarios for your data.
Let us know if the formula needs modification.
 
Upvote 0
So true, added columns and it copied merged cells, sorry for the mess I've been working at this one for seems too long. That said, your formula works! I dragged across from C15 to H15, it added results in C15:E15, since it's calculating dividing B13 by 4, I'm hoping it will return results only in C15:F15, if dividing by 5, it should return results C15:G15, and likewise if dividing by only 2 results to C15:C16.
Actually, it does not, in your Post #7, you wanted to use C15:C19, but the screenshot you show in Post #11 appears that you're using D15:H15.
And Now, your post #13 appears your may have "Merged" cells...

This works in C15 dragged across to G15, without merged cells:

Book3.xlsx
BCDEFG
131148
14
15484    
Sheet833
Cell Formulas
RangeFormula
C15:G15C15=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}),"")


If this works for you, we'll see if we can shorten the formula a bit.
Sorry, my mistake, it works in every way, all good, EUREKA, thank you very much!
 
Upvote 0
You're welcome, thanks for the feedback, glad we figured it out.
 
Upvote 0
You're welcome, thanks for the feedback, glad we figured it out.
I'm sorry to rehash, this formula you provided works great, one thing if I could ask. When the source cell; B13 contains "No Value" due to B7 containing literally no value from its source, B7 is referencing; =IF(Calculations!C10<>"",Calculations!C10,IF(Calculations!C15<>"",Calculations!C15,IF(Calculations!C20<>"",Calculations!C20,IF(Calculations!C26<>"",Calculations!C26,IF(Calculations!C31<>"",Calculations!C31,IF(Calculations!C36<>"",Calculations!C36,"Enter Value In Calculations"))))))
Therefore C15 is returning an error #VALUE! as it's attempting to calculate the text result; "Enter Value In Calculations". Is there a work around for correcting the #VALUE! error in C15 when B13 is not returning a numeric value?
 

Attachments

  • Screen Shot 2021-03-16 at 9.01.17 PM.jpg
    Screen Shot 2021-03-16 at 9.01.17 PM.jpg
    84.5 KB · Views: 3
Upvote 0

Forum statistics

Threads
1,216,042
Messages
6,128,467
Members
449,455
Latest member
jesski

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