Formula with INDEX and IF

Neil_R

New Member
I have a fairly simple formula that I am trying to amend so that inserting a line does not cause the cell values to change using the INDEX command. The formula I was using was:

=IF(E6>0, E6, 0)

Which I have updated to:

=IF(INDEX(C:E,3,3>0),INDEX(C:E,3,3,0))

This produces a #VALUE error so I am obviously have the formatting wrong but cant get my head around what to change, can anyone help?

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

tyija1995

Well-known Member
That IF INDEX combination is always true so you will always return INDEX(C:E,3,3) I.e. the 3rd row and 3rd column of C:E (E3)

It is nested incorrectly hence the error,

It would look like:
=IF(INDEX(C:E,3,3>0),INDEX(C:E,3,3),0)

Though this looks a bit weird to me!!

Fluff

MrExcel MVP, Moderator
If you want E6 it should be
=IF(INDEX(C:E,6,3)>0,INDEX(C:E,6,3),0)

FormR

MrExcel MVP
I think it should look more like:

=IF(INDEX(C:E,6,3)>0,INDEX(C:E,6,3),0)

Change the 6 to 3 if you really meant to say E3 in your description.

steve the fish

Well-known Member
Whats behind the decision to use index thats just pointing at a fixed cell?

1,101,748
Messages
5,482,630
Members
407,355
Latest member
Beinleif

This Week's Hot Topics

• Finding issue in If elseif else with For each Loop
Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
• MsgBox Error
Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
• CELL FORMAT - IF CONDITION
My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
• Show numbers nearly the same
Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...