Index Match with different outcomes

jwoww

New Member
Joined
May 29, 2021
Messages
22
Office Version
  1. 365
I am doing an alternative schedule for something and depending on what the drop down in column a says, sheet 2 has the option and corresponding text for that option i want to be reflected, but i also want it to add what is written in column c to the end. The thing that weirds out my formula is that there are certain drop down options that need to add what is in column b instead of column c.

EG - memorial service in column a will deliver the following text "the family attended a memorial service at the local church" but if column a said festival, the text would read "the family attended the Dog Festival"

example1.xlsx
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
if you add the cell you wan to column C on sheet 2
and then use
=INDEX(Sheet2!B1:B28,MATCH(Sheet1!A1,Sheet2!A1:A28,0))&" "&INDIRECT(INDEX(Sheet2!C1:C28,MATCH(Sheet1!A1,Sheet2!A1:A28,0)))

see a4

example1.xlsx
ABC
1FESTIVALDog FestivalLocal Church
2#N/A
3
4The family attend the Dog Festival
Sheet1
Cell Formulas
RangeFormula
A2A2=INDEX(Sheet2!$B$1:$B$22,((MATCH(A1,Sheet2!$A$1:$A$22,0))&C1),(MATCH(A1,Sheet2!$A$23:$A$24,0))&B1)
A4A4=INDEX(Sheet2!B1:B28,MATCH(Sheet1!A1,Sheet2!A1:A28,0))&" "&INDIRECT(INDEX(Sheet2!C1:C28,MATCH(Sheet1!A1,Sheet2!A1:A28,0)))
Cells with Data Validation
CellAllowCriteria
A1List=Sheet2!$A$1:$A$28


not sure what you want c1 or b1 for all the other entries

example1.xlsx
ABC
1ARRIVEThe family arrive at
2BREAKFASTThe family attend a breakfast at
3BRIEFINGThe family attend a Briefing at
4CEREMONYThe family attend a Ceremony at
5CHURCH SERVICEThe family attend a Church Service at
6COMMEMORATIVE SERVICEThe family attend a Commemorative Service at
7DINNERThe family attend a Dinner at
8FUNERAL SERVICEThe family attend a Funeral Service at
9LUNCHThe family attend a Lunch at
10MEETINGThe family attend a Meeting at
11MEMORIAL SERVICEThe family attend a Memorial Service at thec1
12MORNING TEAThe family attend a Morning Tea at
13PERFORMANCEThe family attend a Performance at
14RECEPTIONThe family attend a Reception at
15SCHOOL VISITThe family attend a School Visit of
16AWARD GALAThe family attend an Award Gala at
17AWARDS CEREMONYThe family attend an Awards Ceremony at
18EVENTThe family attend an Event at
19TRAVELThe family Travel to
20VISITThe family Visit
21GARDEN PARTYThe family host a Garden Party at
22AFTERNOON TEAThe family host an Afternoon Tea at
23BALLThe family attend the
24FESTIVALThe family attend the b1
25CARThe family depart
26DEPARTThe family depart
27FLIGHTThe family depart
28VIDEO RECORDINGThe family Record a Video for
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:B28Other TypeColor scaleNO


link to file here - BUT i only leave on dropbox for a few days
 
Upvote 0
Thanks for what you've done, but when i copy it back into my main spreadsheet (where i need it to go) the phrase that gets copied from sheet 2 doesn't add either the location in column c or the option in column b (depending on what column a says)
 
Upvote 0
can you post the formula - you have entered
and where the Location and option cell is - column C & B - but need the full cell reference C1 , B1 and if you have added that onto the table


or perhaps - if you have no secure data - perhaps save to a share
if you cannot use XL2BB

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
 
Upvote 0
I've uploaded a copy of the actual spreadsheet i will be using (Sheet 1 will be repeated for each of the days throughout the year). The uploaded version just shows random options but column H shows what would be expected to be shown in column d based on what is written in the row above each "timeframe"

The formula box has a couple of option specific formulas based on the response required for that option (ie adding multiple cell words to various positions in a sentence)

Daily Schedule 2023 v4.xlsx
 
Upvote 0
in column C on sheet 2 - you have the cell you need to reference
C1 and B1 seems to be the only entries

if i then look at sheet1
C1
B1
you have a merged cell from A1 to F1
so nothing in C1 or B1

so i'm not sure what you are trying to do - in the this latest sheet ????
 
Upvote 0
in column C on sheet 2 - you have the cell you need to reference
C1 and B1 seems to be the only entries

if i then look at sheet1
C1
B1
you have a merged cell from A1 to F1
so nothing in C1 or B1

so i'm not sure what you are trying to do - in the this latest sheet ????
this sheet is the actual version of what i will be using.

In its simplest form, sheet 1 will list each day's schedule one after another. my formula i need help with needs to determine what the event type will be (cell D5, D11, D14, D17 etc) is and determine what sentence (from sheet 2 column b) corresponds with and inputs that into the relevant cell (D6, D12, D15, D18 etc) and add what appears in column F (cell F5, F11, F14, F17 etc) or column E (cell E5, E11, E14, E17 etc). What determines if either column F or column E is used is whether the event type on sheet 2 is between row 2-row 24 or if its row 25-row 27.
 
Upvote 0
I have changed the C1 and B1 in the lookup table to just 2 or 1
and then used
=INDEX(Sheet2!$B$3:$B$27,MATCH(Sheet1!D5,Sheet2!$A$3:$A$27,0))&IF(INDEX(Sheet2!$C$3:$C$27,MATCH(Sheet1!D5,Sheet2!$A$3:$A$27,0))=2,F5,E5)

that now works with the correct cells copied down

so if the lookup is not a 2 - it will chose E5 .... can nest further if you need other options

=IF(D5="Daily Senior Staff Briefing",("XXXX receives his Daily Senior Staff Briefing"),IF(D5="FLIGHT",("XXXX depart "&F5&" via Plane enroute to "&F8),IF(D5="DEPART",("XXXX depart "&F5&" via Car enroute to "&F8),IF(D5="CAR",("XXXX depart "&F5&" via Car enroute to "&F8),IF(D5="Relax Time",("xxxxx have no events scheduled during this time"),IF(D5="Down Time",("xxxxx have no public events scheduled"),INDEX(Sheet2!$B$3:$B$27,MATCH(Sheet1!D5,Sheet2!$A$3:$A$27,0))&IF(INDEX(Sheet2!$C$3:$C$27,MATCH(Sheet1!D5,Sheet2!$A$3:$A$27,0))=2,F5,E5)))))))

no need for any indirect
just a lookup and IF

may be able to simplify further - but thats

on dropbox - BUT only for a few days


Daily Schedule 2023 v4 -ETAF.xlsx
ABCDEFGH
1SCHEDULE FOR XXXXXXXX
2Sunday, 1 January 2023
3LOCATIONS
4
58:30 AM8:55 AM0:25MEMORIAL SERVICEHome
625 minxxxxx attend a Memorial Service at Homexxxxx attend a Memorial Service at Home
7
89:00 AM9:45 AM0:45PERFORMANCEDog FesitvalSports Park
945 minxxxxx attend a Performance at Sports Parkxxxxx attend a Performance at Sports Park
10
119:50 AM11:00 AM1:10CARLiteracy FestivalLibrary
121 hr, 10 minXXXX depart Library via Car enroute to Shopping CentreXXXX depart Library via Car enroute to Shopping Centre
13
1411:05 AM11:05 AMAWARD GALAShopping Centre
15 xxxxx attend an Award Gala at Shopping Centrexxxxx attend an Award Gala at Shopping Centre
16
1711:10 AM11:10 AMAWARDS CEREMONYBest SwimmerBeach
18 xxxxx attend an Awards Ceremony at Beachxxxxx attend an Awards Ceremony at Beach
19
2011:15 AM11:15 AMGARDEN PARTYTheme Park
21 xxxxx host a Garden Party at Theme Parkxxxxx host a Garden Party at Theme Park
22
2311:20 AM11:20 AMAFTERNOON TEASwimming Pool
24 xxxxx host an Afternoon Tea atSwimming Poolxxxxx host an Afternoon Tea at Swimming Pool
25
2611:25 AM11:25 AMTRAVELAirport
27 xxxxx Travel to Airportxxxxx Travel to Airport
28
2911:30 AM11:30 AMSCHOOL VISITCollege
30 xxxxx attend a School Visit of Collegexxxxx attend a School Visit of College
31
3211:35 AM11:35 AMBALLFootball BallSports Centre
33 xxxxx attend the Football Ballxxxxx attend the Football Ball
34
3511:40 AM11:40 AMFLIGHTAirport
36 XXXX depart Airport via Plane enroute to Hockey RinkXXXX depart Airport via Plane enroute to Hockey Rink
37
3811:55 AM11:55 AMRELAX TIMEHockey Rink
39 xxxxx have no events scheduled during this timexxxxx have no events scheduled during this time
40
4112:00 PM12:00 PMFESTIVALChicken FestivalRestaurant
42 xxxxx attend the Chicken Festivalxxxxx attend the Chicken Festival
43
4412:05 PM12:05 PMCEREMONYCarpark
45 xxxxx attend a Ceremony at Carparkxxxxx attend a Ceremony at Carpark
46
4712:10 PM12:10 PMLUNCHHotel
48 xxxxx attend a Lunch at Hotelxxxxx attend a Lunch at Hotel
49
50RON XXX Home
51RON XXX Hotel
52RON XXX Hotel
53
54
55
56
57
58
Sheet1
Cell Formulas
RangeFormula
A5A5=A2+"8:30"
B5,B47,B44,B41,B38,B35,B32,B29,B26,B23,B20,B17,B14,B11,B8B5=IF(D5="DOWN TIME","",(CEILING((A5+C5),"0:05")))
A6,A48,A45,A42,A39,A36,A33,A30,A27,A24,A21,A18,A15,A12,A9A6=IF(C5="","",IF(HOUR(C5)>0,TEXT(C5,"h")&" hr, ","")&RIGHT(TEXT(C5,"hh:mm"),2)&" min")
D6,D48,D45,D42,D39,D36,D33,D30,D27,D24,D21,D18,D15,D12,D9D6=IF(D5="Daily Senior Staff Briefing",("XXXX receives his Daily Senior Staff Briefing"),IF(D5="FLIGHT",("XXXX depart "&F5&" via Plane enroute to "&F8),IF(D5="DEPART",("XXXX depart "&F5&" via Car enroute to "&F8),IF(D5="CAR",("XXXX depart "&F5&" via Car enroute to "&F8),IF(D5="Relax Time",("xxxxx have no events scheduled during this time"),IF(D5="Down Time",("xxxxx have no public events scheduled"),INDEX(Sheet2!$B$3:$B$27,MATCH(Sheet1!D5,Sheet2!$A$3:$A$27,0))&IF(INDEX(Sheet2!$C$3:$C$27,MATCH(Sheet1!D5,Sheet2!$A$3:$A$27,0))=2,F5,E5)))))))
A8,A47,A44,A41,A38,A35,A32,A29,A26,A23,A20,A17,A14,A11A8=CEILING((B5+"0:05"),"00:05")+(IF(D5="Flight","0:10"))
Cells with Data Validation
CellAllowCriteria
D50:D52List=Sheet2!$F$2:$F$27
D5List=Sheet2!$A$1:$A$48
D8List=Sheet2!$A$1:$A$48
D11List=Sheet2!$A$1:$A$48
D14List=Sheet2!$A$1:$A$48
D17List=Sheet2!$A$1:$A$48
D20List=Sheet2!$A$1:$A$48
D23List=Sheet2!$A$1:$A$48
D26List=Sheet2!$A$1:$A$48
D29List=Sheet2!$A$1:$A$48
D32List=Sheet2!$A$1:$A$48
D35List=Sheet2!$A$1:$A$48
D38List=Sheet2!$A$1:$A$48
D41List=Sheet2!$A$1:$A$48
D44List=Sheet2!$A$1:$A$48
D47List=Sheet2!$A$1:$A$48


Daily Schedule 2023 v4 -ETAF.xlsx
ABCDEF
1EVENT TYPECATEGORYDURATIONRON
2DAILY SENIOR STAFF BRIEFINGxxxxx receives his Daily Senior Staff BriefingFLIGHT TIMEHome
3AFTERNOON TEAxxxxx host an Afternoon Tea at2DRIVE TIMEHotel
4ARRIVExxxxx arrive at 2
5AWARD GALAxxxxx attend an Award Gala at 2
6AWARDS CEREMONYxxxxx attend an Awards Ceremony at 2
7BREAKFASTxxxxx attend a breakfast at 2
8BRIEFINGxxxxx attend a Briefing at 2
9CEREMONYxxxxx attend a Ceremony at 2
10CHURCH SERVICExxxxx attend a Church Service at 2
11COMMEMORATIVE SERVICExxxxx attend a Commemorative Service at 2
12DINNERxxxxx attend a Dinner at 2
13EVENTxxxxx attend an Event at 2
14FUNERAL SERVICExxxxx attend a Funeral Service at 2
15GARDEN PARTYxxxxx host a Garden Party at 2
16LUNCHxxxxx attend a Lunch at 2
17MEETINGxxxxx attend a Meeting at 2
18MEMORIAL SERVICExxxxx attend a Memorial Service at 2
19MORNING TEAxxxxx attend a Morning Tea at 2
20PERFORMANCExxxxx attend a Performance at 2
21RECEPTIONxxxxx attend a Reception at 2
22SCHOOL VISITxxxxx attend a School Visit of 2
23TRAVELxxxxx Travel to 2
24VISITxxxxx Visit 2
25BALLxxxxx attend the 1
26FESTIVALxxxxx attend the 1
27VIDEO RECORDINGxxxxx Record a Video for 1
28CARxxxxx depart
29DEPARTxxxxx depart
30FLIGHTxxxxx depart
31RELAX TIMExxxxx have no events scheduled during this time
32DOWN TIMExxxxx have no public events scheduled
33
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:C32Other TypeColor scaleNO
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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