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",)
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi. I don't know about anyone else, but this is very unclear to me.
Is the data in cols J/K/L somehow derived from the data in cols B/C/D/E ?
If so, how ?
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
For the 1st two, how about
++Fluff.xlsm
BCDEFGHIJKL
1COMPANYAGEPAYERAdult or Child# Visits Allowed?Needs Authorization?
2PAT 115PAYER 1Both24PLAN NAMEADULTCHILDBOTH COMBINED
3PAT 214PAYER 2Child16PAYER 124
4PAT 322PAYER 3Both24PAYER 2816
5PAT 445PAYER 4Adult16PAYER 324
6PAT 511PAYER 5Child16PAYER 41624
7PAT 69PAYER 6Child16PAYER 5816
8PAT 79PAYER 7Both24PAYER 6816
9PAT 867PAYER 4Adult16PAYER 724
10PAT 916PAYER 5Child16PAYER 820
11PAT 1029PAYER 6Adult8
12PAT 1155PAYER 7Both24
13PAT 1212PAYER 8Both20
14PAT 1314PAYER 8Both20
15PAT 1444PAYER 1Both24
16PAT 158PAYER 2Child16
17PAT 1672PAYER 3Both24
18PAT 1716PAYER 8Both20
Main
Cell Formulas
RangeFormula
E2:E18E2=IF(COUNT(INDEX($J$3:$K$10,MATCH(D2,$I$3:$I$10,0),{1,2}))=0,"Both",IF(C2>=18,"Adult","Child"))
F2:F18F2=INDEX($J$3:$L$10,MATCH(D2,$I$3:$I$10,0),MATCH(E2&"*",$J$2:$L$2,0))
 
Upvote 0
Hi. I don't know about anyone else, but this is very unclear to me.
Is the data in cols J/K/L somehow derived from the data in cols B/C/D/E ?
If so, how ?
No - J,K,L are just static values I included there to inform the user of what the visit limits are by age/payer. The only column at the moment that is derived is the column "Adult or Child", and that is derived with a formula based on the "Age" column.


What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Done! Thank you for the tip - btw it is 2016, Windows.
 
Upvote 0
For the 1st two, how about
++Fluff.xlsm
BCDEFGHIJKL
1COMPANYAGEPAYERAdult or Child# Visits Allowed?Needs Authorization?
2PAT 115PAYER 1Both24PLAN NAMEADULTCHILDBOTH COMBINED
3PAT 214PAYER 2Child16PAYER 124
4PAT 322PAYER 3Both24PAYER 2816
5PAT 445PAYER 4Adult16PAYER 324
6PAT 511PAYER 5Child16PAYER 41624
7PAT 69PAYER 6Child16PAYER 5816
8PAT 79PAYER 7Both24PAYER 6816
9PAT 867PAYER 4Adult16PAYER 724
10PAT 916PAYER 5Child16PAYER 820
11PAT 1029PAYER 6Adult8
12PAT 1155PAYER 7Both24
13PAT 1212PAYER 8Both20
14PAT 1314PAYER 8Both20
15PAT 1444PAYER 1Both24
16PAT 158PAYER 2Child16
17PAT 1672PAYER 3Both24
18PAT 1716PAYER 8Both20
Main
Cell Formulas
RangeFormula
E2:E18E2=IF(COUNT(INDEX($J$3:$K$10,MATCH(D2,$I$3:$I$10,0),{1,2}))=0,"Both",IF(C2>=18,"Adult","Child"))
F2:F18F2=INDEX($J$3:$L$10,MATCH(D2,$I$3:$I$10,0),MATCH(E2&"*",$J$2:$L$2,0))

This portion is working like a charm! Thank you! Just need that last one.
 
Upvote 0
What are the criteria for the last column?
 
Upvote 0
What are the criteria for the last column?

There will be another column with a count of visits so far. I would like to have it return either the value "Needs Authorization" or "No Authorization needed at this time" based on whether it comes with 3 or less units from the visit limit.

Book2
BCDEFGHIJKL
1COMPANYAGEPAYERAdult or Child# Visits Allowed?Needs Authorization?Visits so farPLAN NAMEADULTCHILDBOTH COMBINED
2PAT 115PAYER 1Child8PAYER 124
3PAT 214PAYER 2Child1PAYER 2816
4PAT 322PAYER 3Adult4PAYER 324
5PAT 445PAYER 4Adult15PAYER 41624
6PAT 511PAYER 5Child4PAYER 5816
7PAT 69PAYER 6Child3PAYER 6816
8PAT 79PAYER 7Child7PAYER 724
9PAT 867PAYER 4Adult9PAYER 820
10PAT 916PAYER 5Child5
11PAT 1029PAYER 6Adult3
12PAT 1155PAYER 7Adult2
13PAT 1212PAYER 8Child2
14PAT 1314PAYER 8Child3
15PAT 1444PAYER 1Adult3
16PAT 158PAYER 2Child4
17PAT 1672PAYER 3Adult6
18PAT 1716PAYER 8Child7
Sheet2
Cell Formulas
RangeFormula
E2:E18E2=IF(OR(C2>=18),"Adult",)&IF(OR(C2<18),"Child",)


So if a limit is 8 visits, i'd like it to return "Needs Authorization" at >=5 visits and "No Authorization needed at this time" for <5 visits. Same goes with others:

16 visits, i'd like it to return "Needs Authorization" at >=13 visits and "No Authorization needed at this time" for <13.

So if we take Row 5 above, it should be "Needs Authorization" because the limit for adults is 16 and there have been 15 visits so far.
 
Last edited:
Upvote 0
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")
 
Upvote 0

Forum statistics

Threads
1,215,790
Messages
6,126,923
Members
449,348
Latest member
Rdeane

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