Combination of if and index

nskatoch

Board Regular
Joined
Dec 30, 2013
Messages
53
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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,215,564
Messages
6,125,581
Members
449,237
Latest member
Chase S

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