How to eliminate #N/A or replace it?

dennisli828

New Member
Joined
Jul 10, 2011
Messages
9
So my boss ask me to find the data for S&P 500 in different time frame and put it on separate sheets, he also want me to make a main page so that he can choose different time frame with a button, and the corresponding sheet will pop out. I have been trying to figure this out with nested IF but excel said my function exceeded the limit. So I decide to just using the array formula and show "daily" if he chooses "daily". Of course, I highlight the entire column but say for annual data, the length is much shorter and therefore there will be alot of #N/A s. Nobody know how to deal with that?I wanna leave it blank or get rid of it. I have copied my formula, any suggestions? (daily, weekly etc are the names for the data table)

={IF($B$1="daily",daily,IF($B$1="weekly",weekly,IF($B$1="monthly",monthly,IF($B$1="quarterly",quarterly,IF($B$1="annually",annually," ")))))}

you can see the snapshot on:
https://picasaweb.google.com/dennisli828/Jul142011?authkey=Gv1sRgCKOy6r7Tz5qbVg#5629228931035234978


Jul142011
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi,

Try using INDIRECT instead of multiple IF's

=INDIRECT("'"&$B$1&"'!A1)

If B1 was daily, it would look at daily sheet cell A1
 
Last edited:
Upvote 0
Try

=IF(ISERROR(INDIRECT(B1)),"",INDIRECT(B1))

Or in XL2007

=IFERROR(INDIRECT(B1),"")
 
Upvote 0
So where do i plug in my formula?

The same place you put the original formula you posted...

The formula I posted is intended to replace the one you posted...

In other words...
This
={IF($B$1="daily",daily,IF($B$1="weekly",weekly,IF($B$1="monthly",monthly,IF($B$1="quarterly",quarterly,IF($B$1="annually",annually," ")))))}

Can be replaced with
=INDIRECT(B1)

Then to test it for error,
=IFERROR(INDIRECT(B1),"")


Hope that helps.
 
Upvote 0
If there's no other error type you can use goto (F5-special) to select and delete just the cells with formula errors
 
Upvote 0

Forum statistics

Threads
1,215,580
Messages
6,125,652
Members
449,245
Latest member
PatrickL

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