Combination of if and index

nskatoch

Board Regular
Joined
Dec 30, 2013
Messages
63
Office Version
  1. 365
Platform
  1. Windows
Here is the formula I used which contains combination of IF and INDEX

=IF(STREAM!E5:E54>0,INDEX(STREAM!F5:F54,P1,1),INDEX(STREAM!E5:E54,P1,1))

In this, I have faced the problem that only one condition returns output, other returns 0.

If STREAM!E5:E54 is true then it returns the value of INDEX(STREAM!E5:E54,P1,1)

If STREAM!E5:E54 is false then it returns the value 0.
 
Sorry sir it is P1 not P2

I mean it does not returns the value of STREAM!F1:f54 when P1=2 or 4..
 
Upvote 0

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.
My mistake
it should be

IF(INDEX(STREAM!E1:E54,P1,1)<>"",INDEX(STREAM!E1:E54,P1,1),INDEX(STREAM!F1:F54,P1,1))

see end of formula 1 not 2 as previously stated.
 
Last edited:
Upvote 0
With your data as you suggested earlier (ENGLISH in E5) this works

=IF(INDEX(Stream!E5:E54,P1,1)<>"",INDEX(Stream!E5:E54,P1,1),INDEX(Stream!F5:FI54,P1,1))
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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