Nested IF statements and the INDIRECT function in XL2010

jordk

New Member
Joined
May 15, 2013
Messages
2
Hi,

I am having a few issues with the excel autofill function. Here is what I want it to look like:

A
A1=IF(Sheet2!A1>=4,100,IF(Sheet2!A1=3,75,IF(Sheet2!A1=2, 50, IF(Sheet2!A1=1,25))))
A2=-A1
A3=IF(Sheet2!A2>=4,100,IF(Sheet2!A2=3,75,IF(Sheet2!A2=2, 50, IF(Sheet2!A2=1,25))))
A4=-A3
A5=IF(Sheet2!A3>=4,100,IF(Sheet2!A3=3,75,IF(Sheet2!A3=2, 50, IF(Sheet2!A3=1,25))))
A6=-A5

<tbody>
</tbody>

Sheet2 looks something like:

A
A14
A21
A32
A45
A53
A65
A71
A81
A94
A105

<tbody>
</tbody>

Which ultimately returns the following in Sheet1

A
A1100
A2-100
A325
A4-25
A550
A6-50
A7100
A8-100

<tbody>
</tbody>


When I drag the formula's down the page, instead of progressing from Sheet2!A1 to Sheet2!A2 to Sheet2!A3 and from -A1 to -A3 to -A5 etc. as it does in the above iteration, it skips a line and ends up looking like Sheet2!A1 to Sheet2!A3 to Sheet2!A5 and -A2 to -A4 to -A6.

A
A1=IF(Sheet2!A1>=4,100,IF(Sheet2!A1=3,75,IF(Sheet2!A1=2, 50, IF(Sheet2!A1=1,25))))
A2=-A2
A3=IF(Sheet2!A3>=4,100,IF(Sheet2!A3=3,75,IF(Sheet2!A3=2, 50, IF(Sheet2!A3=1,25))))
A4=-A4
A5=IF(Sheet2!A5>=4,100,IF(Sheet2!A5=3,75,IF(Sheet2!A5=2, 50, IF(Sheet2!A5=1,25))))
A6=-A6

<tbody>
</tbody>

I have had a look and I think the INDIRECT function may have something to do with it, but I don't quite understand how to apply it in this scenario.

Any help you can provide would be greatly appreciated.

Thanks





<tbody>
</tbody>
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Welcome to the board. Enter the following into A1, then copy to A3, A5, etc.
=MIN(INDIRECT(ADDRESS(ROUNDUP(ROW()/2,0),1,,,"Sheet2"))*25,100)
 
Upvote 0
Hi,

Thanks for the quick response, that formula works really well (I don't really understand it but that can be some research for tomorrow :P).

I didn't specify this in the original request, however I have noticed if there is not a number in Sheet2, the formula yields 0.

Is there a way I can have the formula yield "" i.e. nothing when there isn't a number in Sheet2?

I tried =IF(ISNUMBER(Sheet2!A1),MIN(INDIRECT(ADDRESS(ROUNDUP(ROW()/2,0),1,,,"Sheet2"))*25,100),"") however I ran into the same issues I was originally having (skipping from A1 to A3 to A5).

Thanks again,
 
Upvote 0
The easiest method would be to format the cell so that if the formula returns 0, it's invisible. Is this acceptable?

Your custom format would be 0;-0;
 
Upvote 0

Forum statistics

Threads
1,216,471
Messages
6,130,823
Members
449,595
Latest member
jhester2010

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