Formula Help

swifttl

New Member
Joined
Jul 18, 2023
Messages
6
Office Version
  1. 365
Hi,

I need a formula that will show me 77% for first 6 months followed by 60% for the remaining 6 months then 60% 3 months later so it shows as below.

1689668350658.png


Any help would be much appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Upvote 0
Welcome to the MrExcel board!

Does this do what you want?

23 07 18.xlsm
EJKLMNOPQRSTUVWXYZ
1
2Month 1Aug-23Sep-23Oct-23Nov-23Dec-23Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24
3Aug-2377%77%77%77%77%77%60%60%60%60%60%60%0%0%60%0%
4Sep-230%77%77%77%77%77%77%60%60%60%60%60%60%0%0%60%
swifttl
Cell Formulas
RangeFormula
K3:Z4K3=LOOKUP(IFERROR(DATEDIF($E3,K$2,"m")+1,0),{0,1,7,13,15,16},{0,0.77,0.6,0,0.6,0})
Hi,

Thanks for this I'll give it a go and see if it works :)

Much Appreciated
 
Upvote 0
Create a month Difference Table to lookup percentages
GetLastRow.xlsm
ABC
33MonthsPct
34-9900
35160.770
367120.600
3713140.000
3815170.600
39180.000
Sheet2


Use the VLOOKUP function to get the desired PCT value based on the Month difference. Month Difference is calculated with a custom VBA function (MonthDiff).
GetLastRow.xlsm
ABCDEFGHIJKLMNOPQRSTUV
41App StartAug-23Sep-23Oct-23Nov-23Dec-23Jan-24Feb-24Mar-24Apr-24May-24Jun-24Jul-24Aug-24Sep-24Oct-24Nov-24Dec-24Jan-25Feb-25Mar-25
4201-Aug-2377%77%77%77%77%77%60%60%60%60%60%60%0%0%60%60%60%0%0%0%
4301-Sep-230%77%77%77%77%77%77%60%60%60%60%60%60%0%0%60%60%60%0%0%
Sheet2
Cell Formulas
RangeFormula
C42,C43:V43C42=VLOOKUP(monthdiff($A42,C$41),TableDatePct,3,TRUE)
D42:V42D42=VLOOKUP(monthdiff($A42,D41),TableDatePct,3,TRUE)
Named Ranges
NameRefers ToCells
TableDatePct=Sheet2!$A$34:$C$39C42:V43

VBA Code:
VBA function
Function MonthDiff(dtRef As Date, dtStart As Date) As Integer
  Dim dt1, dt2
  dt1 = DateSerial(Year(dtRef), Month(dtRef), Day(dtRef))
  dt2 = DateSerial(Year(dtStart), Month(dtStart), Day(dtStart))
  
  MonthDiff = DateDiff("m", dt1, dt2) + 1
End Function
 
Upvote 0

Forum statistics

Threads
1,215,352
Messages
6,124,449
Members
449,160
Latest member
nikijon

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