Combining IF's?

KolbyPanda

New Member
Joined
Jul 3, 2018
Messages
6
Greetings! I've searched around for combining IF commands for a single cell but I may be using the wrong termonology because I am not figuring it out. .

I need to query one cell and display the result on the next tab. I believe my functions are the best for this but I am unable to combine them.

Im working on a separate sheet (Sheet2) with this query

=IF(ISNUMBER(SEARCH("20:00 - 00:00",'Sheet1'!B135)),"NIGHT","")
=IF(ISNUMBER(SEARCH("08:00 - 20:00",'Sheet1'!B135)),"DAY","")
=IF(ISNUMBER(SEARCH("08:00 - 00:00",'Sheet1'!B135)),"24HRS","")

Im asking for a cell to display Day, Night or 24 based on the other sheets cell contents.
The other cell , sheet (B135), will contain and only ONE of the three times.

They all work individually but I cant sandwich them into one cell.. Help?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Depending on the order of which time range you want to check first, then perhaps this:

On the first formula ("NIGHT"), replace the "" at the end with the second formula ("DAY"). On the second formula ("DAY"), replace the "" at the end with the third formula ("24HRS"). Leave the "" at the end of the third formula. Also, the = is only required for the first formula.
 
Upvote 0
Hi,

If B135 can Only have 1 of the 3 possible values, not Blank or anything else, then:

=IF(ISNUMBER(SEARCH("20:00 - 00:00",Sheet1!B135)),"NIGHT",IF(ISNUMBER(SEARCH("08:00 - 20:00",Sheet1!B135)),"DAY","24HRS"))

If B135 may be Blank or something else, then:

=IF(ISNUMBER(SEARCH("20:00 - 00:00",Sheet1!B135)),"NIGHT",IF(ISNUMBER(SEARCH("08:00 - 20:00",Sheet1!B135)),"DAY",IF(ISNUMBER(SEARCH("08:00 - 00:00",Sheet1!B135)),"24HRS","")))
 
Upvote 0
Perfect! I was on the right track when I tried that but didn't know to remove the "" at the ends.. GIANT formula but hey, it works! TY!!!

=IF(ISNUMBER(SEARCH("08:00 - 20:00",'20182021'!B135)),"DAY",IF(ISNUMBER(SEARCH("20:00 - 00:00",'20182021'!B135)),"NIGHT",IF(ISNUMBER(SEARCH("08:00 - 00:00",'20182021'!B135)),"24")))
 
Upvote 0
You either don't need the last IF(ISNUMBER(SEARCH.... or you should add ,"" after "24"

Review the suggestions in my Post #3 again.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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