Excel IF Formula

tropics123

Board Regular
Joined
May 11, 2016
Messages
85
Hi everyone, I need help with this formula. What I'm trying to do is, if the result from a different spreadsheet has the word:

1) "elapsed" anywhere in the sentence, then put in words "Elapsed Time"
2) "consecutive" anywhere in the sentence, then put in the words "Elapsed Time"
3) "hours" anywhere in the sentence, then put in the words "Hours of Service"
If none of those keywords are found, then return the answer "none". My formula is below. I think I'm close, but something is missing. Thank you in advance!

=IF(INDEX('Combined FTW database report'!2:1048576,MATCH('Plan Design'!$B$2,'Combined FTW database report'!$K$2:$K$1048576,0),MATCH("FKEligibleYOS",'Combined FTW database report'!1:1,0))="*elapsed*","Elapsed Time",IF(INDEX('Combined FTW database report'!2:1048576,MATCH('Plan Design'!$B$2,'Combined FTW database report'!$K$2:$K$1048576,0),MATCH("FKEligibleYOS",'Combined FTW database report'!1:1,0))="*consecutive*","Elapsed Time",IF(INDEX('Combined FTW database report'!2:1048576,MATCH('Plan Design'!$B$2,'Combined FTW database report'!$K$2:$K$1048576,0),MATCH("FKEligibleYOS",'Combined FTW database report'!1:1,0))="*hours*","Hours of Service","None")))
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
G'day 'tropics123', It looks to me as though you have left out something.....

'Combined FTW database report'!2:1048576

'Combined FTW database report'!$K$2:$K$1048576
 
Upvote 0
Hi, here's some background on the sheet that the formula is pulling from. Hope this will clear things up.

  • The sheet is named "Combined FTW database report"
  • "2:1048576" is the range starting on row 2
  • Row 1 is the header
 
Upvote 0
I can simplify this so it won't be so messy. For example, based on the sheet below, I'm looking for "Bob" and if in column D:

1) has the word "elapsed" in it, then return this answer "Elapsed Time"
2) has the word "consecutive", then return this answer "Elapsed Time"
3) has the word "hours", then return this answer "Hours of Service"
4) If those keywords "elapsed, consecutive, hours" aren't found in column D for Bob, then return this answer "None"

=IF(INDEX('Combined FTW database report'!2:1048576,MATCH('Plan Design'!Bob,'Combined FTW database report'!$A$2:$A$1048576,0),MATCH("Type of Hours",'Combined FTW database report'!1:1,0))="*elapsed*","Elapsed Time",IF(INDEX('Combined FTW database report'!2:1048576,MATCH('Plan Design'!Bob,'Combined FTW database report'!$A$2:$A$1048576,0),MATCH("Type of Hours",'Combined FTW database report'!1:1,0))="*consecutive*","Elapsed Time",IF(INDEX('Combined FTW database report'!2:1048576,MATCH('Plan Design'!Bob,'Combined FTW database report'!$A$2:$A$1048576,0),MATCH("Type of Hours",'Combined FTW database report'!1:1,0))="*hours*","Hours of Service","None")))

Issue I have with the formula is, it returns the answer "none" no matter what.

Column A - NameColumn B - Date of BirthColumn C - Hours WorkedColumn D - Type of HoursColumn E - MemberColumn F -Type of Employment
Bob1/2/19601000Elapsed Time w/ ConditionsYesPart-Time
Mary5/5/19872000Hours of Service w/ LimitYesFull-time
Woody3/8/1999500Specific HoursYesPart-time
Dylan12/30/2000890Consecutive HoursNoPart-time
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

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