Help with Formulas

lollypop1389

New Member
Joined
Jul 8, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I was wondering if I could have some help in creating a formula, I have been struggling for days trying to figure out if this is even achievable. I'm trying to create a way to highlight when a patient needs to be transferred to another hospital.

In column G I have a drop down list of treatment options e.g. surgery, radiotherapy etc. In column H I have the date which treatment started on e.g. 03/03/2020. Is there a way to create a formula/conditional formatting rule wherein if "Surgery" is written in Column G, and the start date in Column H is "today minus 2 months", then it will highlight that row. Similarly if "Radiotherapy" is written in Column G, then the start date should trigger the row to be highlighted after 6 months time.

I would be really grateful for any help or advice. I am really struggling and would like to know if this is even achievable or if I am wasting my time trying to figure it all out.

Many Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi Lollypop1389,

You don't say how many treatment options you have so I'll assume your Data Validation List is in a table then I'll add a column for the months trigger (columns L and M which can be hidden or on another tab).

Lollypop1389.xlsx
GHIJKLM
1Treatment OptionTreatment StartedTreatmentsMonths
2Surgery08-May-20Surgery2
3Radiotherapy05-May-20Radiotherapy6
4Physical Therapy06-Jun-20Physical Therapy4
5Reiki08-Jun-20Reiki1
6Radiotherapy01-Jan-20
7Surgery09-May-20
8
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G2:H9Expression=EDATE($H2,(INDEX($M$2:$M$99,MATCH($G2,$L$2:$L$99,0))))<=TODAY()textNO
Cells with Data Validation
CellAllowCriteria
G2:G7List=$L$2:$L$5
 
Upvote 0
Hi Toadstool, Wow thank you so much for this!! I have a column in another spreadsheet for the treatment options and there are 9 options.
The way that you have done the treatment options and the months, do I just need to copy and paste your formula in (replacing with my column letters) essentially?
 
Upvote 0
**sorry, meant to say the columns are in another tab, not another spreadsheet!
 
Upvote 0
You'll need to point the formula at the other sheet and columns.

Here I have the Data Validation list on Sheet2 in columns C and D

Lollypop1389.xlsx
CD
1TreatmentsMonths
2Surgery2
3Radiotherapy6
4Physical Therapy4
5Reiki1
6Treat 55
7Treat 66
8Treat 77
9Treat 88
10Treat 99
Sheet2


The Sheet1 entry has to change the formulae to point at the other sheet:

Lollypop1389.xlsx
GH
1Treatment OptionTreatment Started
2Surgery08-May-20
3Radiotherapy05-May-20
4Physical Therapy06-Jun-20
5Reiki08-Jun-20
6Radiotherapy01-Jan-20
7Surgery09-May-20
8
9
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G2:H99Expression=EDATE($H2,(INDEX(Sheet2!$D$2:$D$10,MATCH($G2,Sheet2!$C$2:$C$10,0))))<=TODAY()textNO
Cells with Data Validation
CellAllowCriteria
G2:G9List=Sheet2!$C$2:$C$10
 
Upvote 0
I've tried to add the formula but it is not working. The tables are on another tab as below.
1594211621471.png



1594211648753.png
 
Upvote 0
I've changed the sheet names to match yours. I note you have tables for the dropdown but as I can't be sure of your table names I've just used standard addressing.

Lollypop1389.xlsx
CD
1Primary TreatmentColumn 2
2Surgery3
3Radiotherapy6
4Chemo/Radiotherapy6
5Chemotherapy6
6Monitor1
7Transfer Care1
8Palliative Radiotherapy4
9Palliative Chemotherapy4
10BSC1
Drop Down Menus


I've tried to match your row setup for Main Database

Lollypop1389.xlsx
GH
1Primary TreatmentDate P. Treatment
2
3
4TBC
5Surgery08-Apr-20
6Chemo/Radiotherapy05-May-20
7Monitor06-Jun-20
8Palliative Radiotherapy08-Jun-20
9Radiotherapy01-Jan-20
10Surgery09-Apr-20
11
Main Database
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G5:H102Expression=EDATE($H5,(INDEX('Drop Down Menus'!$D$2:$D$10,MATCH($G5,'Drop Down Menus'!$C$2:$C$10,0))))<=TODAY()textNO
Cells with Data Validation
CellAllowCriteria
G5:G11List='Drop Down Menus'!$C$2:$C$10
 
Upvote 0
Hi Toadstool,

Thank you so much I really do appreciate your help. I am still really struggling to get this to work. Would it be possible/is it allowed to send you the spreadsheet at all. I just don't understand why I can get it to work for me.
 
Upvote 0
The MrExcel crew don't like posted issues being worked outside of the forum but if you can make sure any personal data is anonymized and provide it via some media such as Dropbox then I, and others, can resolve your challenge.
 
Upvote 0
Cross posted highlight when a patient needs to be transferred to another hospital

While we do allow Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,214,847
Messages
6,121,911
Members
449,054
Latest member
luca142

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