forgetso
Board Regular
- Joined
- Sep 18, 2007
- Messages
- 198
I have a formula which is too long. I have tried to span it over more than one line by typing a space and then an underscore but I still get a syntax error.
Here is the formula:
<code>
"=IF(ISNA(INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station1 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)),0, INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station1 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)) * IF(ISNA(INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station1 & ",DailyImpacts!$o$3:$o$50,0),1)),0, INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station1 & ",DailyImpacts!$o$3:$o$50,0),1)) +IF(ISNA(INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station2 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)),0, INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station2 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)) * IF(ISNA(INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station2 & ",DailyImpacts!$o$3:$o$50,0),1)),0, INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station2 & ",DailyImpacts!$o$3:$o$50,0),1)) + IF(ISNA(INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station3 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)),0, INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station3 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)) * IF(ISNA(INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station3 & ",DailyImpacts!$o$3:$o$50,0),1)),0, INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station3 & ",DailyImpacts!$o$3:$o$50,0),1))”
</code>
Any ideas?
EDIT:
I have since changed the variable names: StationNameEndCell to SNEC and StationEndCell to SEC but it is still too long.
Here is the formula:
<code>
"=IF(ISNA(INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station1 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)),0, INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station1 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)) * IF(ISNA(INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station1 & ",DailyImpacts!$o$3:$o$50,0),1)),0, INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station1 & ",DailyImpacts!$o$3:$o$50,0),1)) +IF(ISNA(INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station2 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)),0, INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station2 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)) * IF(ISNA(INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station2 & ",DailyImpacts!$o$3:$o$50,0),1)),0, INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station2 & ",DailyImpacts!$o$3:$o$50,0),1)) + IF(ISNA(INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station3 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)),0, INDEX(StationInfo!$A$2:" & StationEndCell & ",MATCH(Summary!" & Station3 & ",StationInfo!$B$2:" & StationNameEndCell & ",0),3)) * IF(ISNA(INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station3 & ",DailyImpacts!$o$3:$o$50,0),1)),0, INDEX(DailyImpacts!$I$3:$o$50,MATCH(Summary!" & Station3 & ",DailyImpacts!$o$3:$o$50,0),1))”
</code>
Any ideas?
EDIT:
I have since changed the variable names: StationNameEndCell to SNEC and StationEndCell to SEC but it is still too long.
Last edited: