Excel Formula --> Return column heading dependent on data in rows (& conditions)

Y_Shah2475

New Member
Joined
Oct 13, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi there,

Kindly looking for some help on the following roadblock I’ve hit:

Context:

I work for a consulting business. Depending on rules (which I won’t go into), we determine whether a client is considered “New Business” for a given Year.

For example, in the screenshot below, you will see client A is considered “New Business” in 2019, 2021 and 2023; client B in 2020 and 2023; and so on…

What I need help with:

I’m trying to create a drag-and-drop formula in column L starting in cell L4, that allows me to match the project to the relevant year that the client is considered ‘New Business’, given the following conditions:
  • If the ‘project start date’ is in the same year that the client was considered ‘New Business’, then that is the year I’m trying to return
    • Example – Row 4: Project #1 starts in Jan-19 (E4) and the client was considered ‘New Business’ in 2019, therefore the result I’m trying to return in L4 is “2019"
  • If the ‘project start date’ is not in the same year that the client was considered ‘New Business’, then I’m trying to return the closest historical year to project start date in which the client was considered ‘New Business’
    • Example – Row 5: Project #2 starts in May-22 (E5), but the client was not considered ‘New Business in 2022. Therefore I want to return the closest historical year in which the client was considered ‘New Business’ - In this case it would be “2021” that I’m trying to return in cell L5
Hope the above is clear – any help would be hugely appreciated!

Thanks so much,


Y
 

Attachments

  • Excel Help.png
    Excel Help.png
    55.7 KB · Views: 10

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi there,

Kindly looking for some help on the following roadblock I’ve hit:

Context:

I work for a consulting business. Depending on rules (which I won’t go into), we determine whether a client is considered “New Business” for a given Year.

For example, in the screenshot below, you will see client A is considered “New Business” in 2019, 2021 and 2023; client B in 2020 and 2023; and so on…

What I need help with:

I’m trying to create a drag-and-drop formula in column L starting in cell L4, that allows me to match the project to the relevant year that the client is considered ‘New Business’, given the following conditions:
  • If the ‘project start date’ is in the same year that the client was considered ‘New Business’, then that is the year I’m trying to return
    • Example – Row 4: Project #1 starts in Jan-19 (E4) and the client was considered ‘New Business’ in 2019, therefore the result I’m trying to return in L4 is “2019"
  • If the ‘project start date’ is not in the same year that the client was considered ‘New Business’, then I’m trying to return the closest historical year to project start date in which the client was considered ‘New Business’
    • Example – Row 5: Project #2 starts in May-22 (E5), but the client was not considered ‘New Business in 2022. Therefore I want to return the closest historical year in which the client was considered ‘New Business’ - In this case it would be “2021” that I’m trying to return in cell L5
Hope the above is clear – any help would be hugely appreciated!

Thanks so much,


Y
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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