Is Their an Order of Operations for Functions ?

NegativeKurtosis

New Member
Joined
Jan 14, 2018
Messages
15
Hello,

Wondering if their is an order of operations for functions ? If so, what would it be in the following instance; or is their a better way to achieve the following.
Here is a breakdown of the problem :

I need to find a value ( AW5 )
That value could be positive or negative ( AW5>0, or AW5<0 )
If it is positive I consult ( VLOOKUP ) the value in range ( $AL$3:$AO$17199 ).
If it is negative I consult ( VLOOKUP ) the value in range ( $AP$3:$AS$17199 ).
If the value can't be found and produces an error in a table ( Use
IFERROR ) then I would like to populate the value " 0.00 ".

See a couple of my current code examples below :

=IFERROR(VLOOKUP(AW5,$AL$3:$AO$17199,4,TRUE),"0.00"),IF(AW5>0,VLOOKUP(AW5,$AL$3:$AO$17199,4,TRUE), VLOOKUP(AW5,$AP$3:$AS$17199,4,TRUE),IFERROR(VLOOKUP(AW5,$AP$3:$AS$17199,4,TRUE),"0.00"),IF(AW5<0,VLOOKUP(AW5,$AP$3:$AS$17199,4,TRUE)

=IFERROR(IF(AW5>0,VLOOKUP(AW5,$AL$3:$AO$17199,4,TRUE)),"0.00"), IFERROR(IF(AW5<0,VLOOKUP(AW5,$AP$3:$AS$17199,4,TRUE)),"0.00")

My question is which function do I start with in this instance ? Or do I abandon this approach and try another approach or function ? I have tried many different functions and combinations, but to no avail. Any suggestions would be greatly appreciated !

Thanks,
Richard
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try this instead

=IFERROR(VLOOKUP(AW5,IF(AW5>0,$AL$3:$AO$17199,$AP$3:$AS$17199),4,0),0)

QUESTION: What range do you look up if AW5 equals 0 ? You haven't specified this situation
 
Last edited:
Upvote 0
Try this instead

=IFERROR(VLOOKUP(AW5,IF(AW5>0,$AL$3:$AO$17199,$AP$3:$AS$17199),4,0),0)

QUESTION: What range do you look up if AW5 equals 0 ? You haven't specified this situation

Special-K99,

Thanks for the reply; in regards to the " 0 " situation, that is a good question ! Theoretically, it should never encounter zero UNTIL I put " 0.00 " in as an alternative to an error. Therefore, I will change the " error trapping " alternative to " 1.00 ".

Thanks,
Richard
 
Upvote 0
Special-K99,

Thanks for the reply; in regards to the " 0 " situation, that is a good question ! Theoretically, it should never encounter zero UNTIL I put " 0.00 " in as an alternative to an error. Therefore, I will change the " error trapping " alternative to " 1.00 ".

Thanks,
Richard

Special-K99,

That worked beautifully ! And helped me understand how to nest with these multiple functions in the future, thank you !

Richard
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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