Formula with INDEX and IF

Neil_R

New Member
Joined
Jun 18, 2019
Messages
5
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?
 

Some videos you may like

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
Joined
Feb 26, 2019
Messages
766
Office Version
365
Platform
Windows
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
Joined
Jun 12, 2014
Messages
42,320
Office Version
365
Platform
Windows
If you want E6 it should be
=IF(INDEX(C:E,6,3)>0,INDEX(C:E,6,3),0)
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,408
Office Version
365
Platform
Windows
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
Joined
Oct 20, 2009
Messages
8,080
Office Version
365
Platform
Windows
Whats behind the decision to use index thats just pointing at a fixed cell?
 

Watch MrExcel Video

Forum statistics

Threads
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...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top