building off previous column formula

Castor

New Member
Joined
Mar 20, 2019
Messages
20
Office Version
  1. 2016
Platform
  1. Windows
Hey there,

Got one that has stumped me! below is a small sample of a table i am working with. I have already created a column formula to return 'Adult' or 'Child' based on age.

What I need is for that formula to also take into account 'Both' since for some payers they do not differentiate by adult/child.

Next, What I need to do is in the next column, return a given number of visits allowed based on the adult/child/both column and payer. There is a table that stipulates the visits allowed by age and payer. I tried if/or/and formulas but could not get it to work myself for the different payers/visit limits.

Last, once we have those two columns solved, I wanted to add another column to return whether authorization is required at this time based on payer, age, and whether or not the number of visits (specific to each payer) are approaching the visit limits.

Please let me know if this is not clear or if anything else can be provided. Help is greatly appreciated! or if other more efficient ways are thought of, I'm all ears. Looking to learn.

Book2
BCDEFGHIJKL
1COMPANYAGEPAYERAdult or Child# Visits Allowed?Needs Authorization?
2PAT 115PAYER 1ChildPLAN NAMEADULTCHILDBOTH COMBINED
3PAT 214PAYER 2ChildPAYER 124
4PAT 322PAYER 3AdultPAYER 2816
5PAT 445PAYER 4AdultPAYER 324
6PAT 511PAYER 5ChildPAYER 41624
7PAT 69PAYER 6ChildPAYER 5816
8PAT 79PAYER 7ChildPAYER 6816
9PAT 867PAYER 4AdultPAYER 724
10PAT 916PAYER 5ChildPAYER 820
11PAT 1029PAYER 6Adult
12PAT 1155PAYER 7Adult
13PAT 1212PAYER 8Child
14PAT 1314PAYER 8Child
15PAT 1444PAYER 1Adult
16PAT 158PAYER 2Child
17PAT 1672PAYER 3Adult
18PAT 1716PAYER 8Child
Sheet2
Cell Formulas
RangeFormula
E2:E18E2=IF(OR(C2>=18),"Adult",)&IF(OR(C2<18),"Child",)
 
Ok, how about
Excel Formula:
=IF(COUNTIFS(D$2:D2,D2,E$2:E2,E2)>=F2-3,"Needs Authorization","No Authorization needed at this time")

This is excellent, we are getting so close but not quite there. So I left out a column in my first table that gave a count of visits that already occurred. We want to return the "Needs..." or "No Auth..." based on whether the number of visits that have already occurred is within 3 visits of the limits. Below has the column for count.


See below


Book2
BCDEFGHIJKL
1COMPANYAGEPAYERAdult or Child# Visits Allowed?Visits so farNeeds Authorization?PLAN NAMEADULTCHILDBOTH COMBINED
2PAT 115PAYER 1Child248PAYER 124
3PAT 214PAYER 2Child161PAYER 2816
4PAT 322PAYER 3Adult244PAYER 324
5PAT 445PAYER 4Adult1615PAYER 41624
6PAT 511PAYER 5Child164PAYER 5816
7PAT 69PAYER 6Child163PAYER 6816
8PAT 79PAYER 7Child247PAYER 724
9PAT 867PAYER 4Adult169PAYER 820
10PAT 916PAYER 5Child165PAYER 9UNLIMITED
11PAT 1029PAYER 6Adult83PAYER 10UNLIMITED
12PAT 1155PAYER 7Adult242PAYER 11UNLIMITED
13PAT 1212PAYER 8Child202
14PAT 1314PAYER 8Child203
15PAT 1444PAYER 1Adult243
16PAT 158PAYER 2Child164
17PAT 1672PAYER 3Adult246
18PAT 1716PAYER 8Child207
19PAT 1817PAYER 9ChildUNLIMITED8
20PAT 1918PAYER 10AdultUNLIMITED9
21PAT 2019PAYER 11AdultUNLIMITED10
Sheet2
Cell Formulas
RangeFormula
E2:E21E2=IF(OR(C2>=18),"Adult",)&IF(OR(C2<18),"Child",)
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
So I left out a column in my first table that gave a count of visits that already occurred.
Pretty major thing to "forget".
Can you post the data complete with the updated formulae.
 
Upvote 0
Pretty major thing to "forget".
Can you post the data complete with the updated formulae.
My apologies, it was an afterthought. See below, let me know this is all you need.

Book2
BCDEFGHIJKL
1COMPANYAGEPAYERAdult or Child# Visits Allowed?Visits so farNeeds Authorization?PLAN NAMEADULTCHILDBOTH
2PAT 115PAYER 1Both248PAYER 124
3PAT 214PAYER 2Child161PAYER 2816
4PAT 322PAYER 3Both244PAYER 324
5PAT 445PAYER 4Adult1615PAYER 41624
6PAT 511PAYER 5Child164PAYER 5816
7PAT 69PAYER 6Child163PAYER 6816
8PAT 79PAYER 7Both247PAYER 724
9PAT 867PAYER 4Adult169PAYER 820
10PAT 916PAYER 5Child165PAYER 9UNLIMITED
11PAT 1029PAYER 6Adult83PAYER 10UNLIMITED
12PAT 1155PAYER 7Both242PAYER 11UNLIMITED
13PAT 1212PAYER 8Both202
14PAT 1314PAYER 8Both203
15PAT 1444PAYER 1Both243
16PAT 158PAYER 2Child164
17PAT 1672PAYER 3Both246
18PAT 1716PAYER 8Both207
19PAT 1817PAYER 9BothUNLIMITED8
20PAT 1918PAYER 10BothUNLIMITED9
21PAT 2019PAYER 11BothUNLIMITED10
Sheet2
Cell Formulas
RangeFormula
E2:E21E2=IF(COUNT(INDEX($J$2:$L$12,MATCH(D2,$I$2:$I$12,0),{1,2}))=0,"Both",IF(C2>=18,"Adult","Child"))
F2:F21F2=INDEX($J$2:$L$12,MATCH(D2,$I$2:$I$12,0),MATCH(E2&"*",$J$1:$L$1,0))
 
Upvote 0
Thanks for that, but on closer inspection the number of visits makes no sense. How can Payer 1 go from 8 visits to 3, or Payer 4 from 15 to 9 amongst others.
 
Upvote 0
Thanks for that, but on closer inspection the number of visits makes no sense. How can Payer 1 go from 8 visits to 3, or Payer 4 from 15 to 9 amongst others.
Think of it as 'pat'= patient, and "payer" = insurance. So Pat 1 and Pat 14 both have the same payer with the same visit limits, but Pat 1 has been to the doctor 8 times, and Pat 14 has been to the doctor 3 times. They're both limited to 24 visits before authorization is needed. So for both, it should be 'No Auth needed at this time'.

Does that help?
 
Upvote 0
Ok, how about
Excel Formula:
=IF(OR(G2<N(F2)-3,F2="Unlimited"),"No Authorization needed at this time","Needs Authorization")
 
Upvote 0
Solution
Ok, how about
Excel Formula:
=IF(OR(G2<N(F2)-3,F2="Unlimited"),"No Authorization needed at this time","Needs Authorization")
Thank you so much. It worked like a charm. I even added a third condition for 'exceeds auth limits' using your suggestion as a base.

Book2
BCDEFGHIJKLM
1COMPANYAGEPAYERAdult or Child# Visits Allowed?Visits so farNeeds Authorization?PLAN NAMEADULTCHILDBOTH
2PAT 115PAYER 1Both248No Authorization needed at this timePAYER 124
3PAT 214PAYER 2Child161No Authorization needed at this timePAYER 2816
4PAT 322PAYER 3Both244No Authorization needed at this timePAYER 324
5PAT 445PAYER 4Adult1615Needs AuthorizationPAYER 41624
6PAT 511PAYER 5Child164No Authorization needed at this timePAYER 5816
7PAT 69PAYER 6Child163No Authorization needed at this timePAYER 6816
8PAT 79PAYER 7Both247No Authorization needed at this timePAYER 724
9PAT 867PAYER 4Adult169No Authorization needed at this timePAYER 820
10PAT 916PAYER 5Child165No Authorization needed at this timePAYER 9UNLIMITED
11PAT 1029PAYER 6Adult83No Authorization needed at this timePAYER 10UNLIMITED
12PAT 1155PAYER 7Both2425Exceeded Authorization LimitPAYER 11UNLIMITED
13PAT 1212PAYER 8Both202No Authorization needed at this time
14PAT 1314PAYER 8Both203No Authorization needed at this time
15PAT 1444PAYER 1Both243No Authorization needed at this time
16PAT 158PAYER 2Child1618Exceeded Authorization Limit
17PAT 1672PAYER 3Both246No Authorization needed at this time
18PAT 1716PAYER 8Both207No Authorization needed at this time
19PAT 1817PAYER 9BothUNLIMITED8No Authorization needed at this time
20PAT 1918PAYER 10BothUNLIMITED9No Authorization needed at this time
21PAT 2019PAYER 11BothUNLIMITED10No Authorization needed at this time
Sheet2
Cell Formulas
RangeFormula
E2:E21E2=IF(COUNT(INDEX($K$2:$M$12,MATCH(D2,$J$2:$J$12,0),{1,2}))=0,"Both",IF(C2>=18,"Adult","Child"))
F2:F21F2=INDEX($K$2:$M$12,MATCH(D2,$J$2:$J$12,0),MATCH(E2&"*",$K$1:$M$1,0))
H2:H21H2=IF(OR(G2<N(F2)-3,F2="Unlimited"),"No Authorization needed at this time",IF(OR(G2>N(F2)),"Exceeded Authorization Limit","Needs Authorization"))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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