error in formula

Blackwell

Board Regular
Joined
Oct 19, 2007
Messages
96
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys, I am trying to find the correct formula between the value for 40% tax. If C2 is between C3:C4, then that value goes to C5, if the value is less than C3 input 0 in C5.
C2 21,905
C3 6283
C4 20,857
C5 14,574
This is the formula I am using =IF(AND(C2>C3,C2:C4),IF(C2>C3,C4-C3),0). When the value is less in C2 it does not return "0"

C2 1,953
C3 3,142
C4 10,482
C5 TRUE
This is the formula I am using =IF(C2>C3,0)=IF(AND(B2>B3,B2:B4),IF(B2>B3,B4-B3),0) C5 is showing TRUE instaed of "0"
Thank you in advance.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
What value do you actually want in C5? The amount of C2 that falls between C3 and C4 (i.e. greater of 0 and C2-C3, but capped at C4), or the value of C2 if it falls in the range, or something else? For the former, MEDIAN would be the simplest option:

=MEDIAN(0,C2-C3,C4)
 
Upvote 0
Hello RoryA, Thank you for replying. actually, no, what I want is If C2 is between C3 and C4, then the value between c3 and C4 which is 14,574 to go to C5. If C2 is less than C3 then in C5 "0". If C2 is higher than C4 then the value between C3 and C4 goes into C5. I hope that is understandable.
 
Upvote 0
In that case:

=MEDIAN(0,C2-C3,C4-C3)
 
Upvote 0
Hi RoryA, sorry that is not working. It produces 7,287; it should be 14,574. I am not sure I have explained this well enough.
what I want is If C2 is more than C3 and within C4 then the value between c3 and C4 which is 14,574 goes to C5. The
If C2 is less than C3, then in C5 "0". If C2 is higher than C4 then the value between C3 and C4 goes into C5.
 
Upvote 0
I am so sorry you are right. It does work correctly, I tried it in a new sheet, and it is fine. I have made an error somewhere. But Thank you
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,819
Members
449,469
Latest member
Kingwi11y

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