IFERROR equivalent (if then else)

MartinL

Well-known Member
Joined
Oct 16, 2008
Messages
1,141
Office Version
  1. 365
Platform
  1. Windows
I have check two columns of data to get a reliable result as a result of building the two columns either, both nor neither columns will contain Error - in my case its always Expression.Error: The 'offset' argument is out of range. due to a Text.Range type formula, which is fine

What I next need to do is something along the lines of if column A [HasError] then column B else column A
if after this there are still errors then I can use the Remove Errors function.

But how do I write the if...then...else statement
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I have check two columns of data to get a reliable result as a result of building the two columns either, both nor neither columns will contain Error -

Ok A workaround was to avoid the Error in the first place :oops:
What I have done is use:
Code:
try Text.Range([Column A],Text.PositionOf([Column A], "T"), 5)&"40" otherwise "X"
Code:
try Text.Range([Column B],Text.PositionOf([Column B], "T"), 5)&"40" otherwise "X"
Code:
[if Text.Start([Columm A],1)="X" then [ColumnB] else [Column A]

And then filter where Column C does not equal "X"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

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