checking the date to change the result

mwvirk

Active Member
Joined
Mar 2, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
in this existing formula in cell D1, I want to check if the date in A1 is equal to or higher than 01-July-2023 then deduct 10% from the answer
e.g. if B1 is a value of 100 and C1 is 10% then calculate B1*C1 and the result will be 10 in D1
from this result (10) in D1, I want to deduct 10% of D1 if the date in A1 is equal to or higher than 01-July-2023 so the result will be 9

my existing formula is: =IF(AND(B1<>"",C1<>""),B1*C1,"") where I am checking if the cell value is not "" and I also want to keep this exciting setting.



MWVirk PSX Portfolio v0004.xlsx
ABCD
11-Jul-202310010%10
Sheet1
Cell Formulas
RangeFormula
D1D1=IF(AND(B1<>"",C1<>""),B1*C1,"")
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try this:

=IF(AND(B1<>"",C1<>""),B1*C1*IF(A1>=DATE(2023,7,1),0.9,1),"")
 
Upvote 1
perfect.
1 small concern if this can be answered.
if the result is higher than 10.50 then it returns the answer 11
I want to get the result 10 only no matter what the amount is after decimal. e.g. even if the amount is 10.10 or 10.20 or 10.50 or 10.55 or 10.90
in all cases, I want the result to be 10

I was trying the check the results in this small sheet:



Book1
ABCDE
111-Jun-202410012%11
210.80
Sheet1
Cell Formulas
RangeFormula
D1D1=IF(AND(B1<>"",C1<>""),B1*C1*IF(A1>=DATE(2023,7,1),0.9,1),"")
E2E2=IF(AND(B1<>"",C1<>""),B1*C1*IF(A1>=DATE(2023,7,1),0.9,1),"")
 
Upvote 0
=IF( AND (B1<>" ",C1<>""),TRUNC(B1*C1*IF(A1>= DATE(2023,7,1),0.9,1)) ,"")
 
Upvote 0
please check this. results is 10 but still showing 9


Book1
ABCDE
111-Jun-202410011.11%9
210.00
Sheet1
Cell Formulas
RangeFormula
D1D1=IF(AND(B1<>" ",C1<>""),TRUNC(B1*C1*IF(A1>= DATE(2023,7,1),0.9,1)),"")
E2E2=IF(AND(B1<>"",C1<>""),B1*C1*IF(A1>=DATE(2023,7,1),0.9,1),"")
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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