Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() Is there a better way than this to code IF statements in a worksheet? Code: -------------------- =IF(H8=1, A1, IF(H8=2, A2, IF(H8=3, A3, A4))) -------------------- As the code shows, the common reference cell is H8 and the IF statement checks it's value (from a range of 1-3) and then makes the target cell equal one out of a range of cells depending on the outcome. This is a short example but I have some very long and complex IF statements that use this method and was wondering if there was a way to simplify e.g. by using array formulas or something similar? Something along the lines of: Code: -------------------- =[IF(H8 = 1;2;3, A1;A2;A3, A4)] -------------------- That obviously doesn't work but that's the kind of thing I was thinking. Cheers -Rob -- TheRobsterUK ------------------------------------------------------------------------ TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924 View this thread: http://www.excelforum.com/showthread...hreadid=387970 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using other workbooks.. | Excel Worksheet Functions | |||
Make Change Case in Excel a format rather than formula | Excel Worksheet Functions | |||
Opening a file with code without a set file name | Excel Discussion (Misc queries) | |||
Opening a file with code without a set file name | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) |