Single column result based on 2 columns and 5 ranges

bomijoff

New Member
Joined
Feb 19, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Morning!
Firstly sorry for the terrible thread name.
I'm looking to auto populate column C based on the date of B looking at which range it fits between on E&F with the result of G, if B is blank then to look at A and again look at which date fits between E&F with the result being G.

Examples:
C2 would look at the date of B2 to see which range it fits between E & F, since it is 2-Feb-23 the result would be TBC as it sits between the dates of E6 & F6. Doesn't need to look at A2 as B2 is populated.
C4 would look at the date of B4 and see that it's blank so would then look at A4 and find the range it fits between in E & F, since it is 6-Feb-13 the result would be 31-Dec-23 as it sits between the dates of E4 & F4.

I was looking at doing something like B2=">="&E2 and B2="=<"&F2 then result is G2, if B2 is blank then A2=">="&E2 and A2"=<"&F2. i got lost when i realised it would be a bigger formula and trying to actually make it work and fit it together!

1690964209404.png


Just a note that column A has no blank fields.
Any help would be greatly appreciated!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Consider posting some XL2BB in the future.

Anyway try:
Book89
ABCDEFG
1
203-Jan-0802-Feb-23TBC01-Dec-0631-Dec-0931-Mar-22
301-May-1102-Feb-1331-Dec-2301-Jan-1031-Dec-1231-Dec-22
406-Feb-1331-Dec-2301-Jan-1331-Dec-1431-Dec-23
502-Feb-0728-Oct-0931-Mar-2201-Jan-1531-Dec-1731-Dec-24
601-Jan-1802-Aug-23TBC
Sheet1
Cell Formulas
RangeFormula
C2:C5C2=INDEX($G$2:$G$6,MATCH(1,(MAX($A2:$B2)<$F$2:$F$6)*(MAX($A2:$B2)>$E$2:$E$6),0))
F6F6=TODAY()
 
Upvote 0
Solution
Consider posting some XL2BB in the future.

Anyway try:
Book89
ABCDEFG
1
203-Jan-0802-Feb-23TBC01-Dec-0631-Dec-0931-Mar-22
301-May-1102-Feb-1331-Dec-2301-Jan-1031-Dec-1231-Dec-22
406-Feb-1331-Dec-2301-Jan-1331-Dec-1431-Dec-23
502-Feb-0728-Oct-0931-Mar-2201-Jan-1531-Dec-1731-Dec-24
601-Jan-1802-Aug-23TBC
Sheet1
Cell Formulas
RangeFormula
C2:C5C2=INDEX($G$2:$G$6,MATCH(1,(MAX($A2:$B2)<$F$2:$F$6)*(MAX($A2:$B2)>$E$2:$E$6),0))
F6F6=TODAY()
This is perfect and unbelieveable helpful to me, thank you so much.
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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