GOOGLE SHEETS: VLOOKUP with IF OR returning N/A or BLANK

Status
Not open for further replies.

UniqueUsername

New Member
Joined
Dec 9, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
REPOSTED from:



I build my spreadsheets in EXCEL and then once I've laid everything out the way I like, I build it in Google Sheets. I've never ran into an issue until today. I posted the above question in the Excel forms and received a great answer, but it only works in Excel. Below is the exact question. The screen shot is from Excel, but is just there to help visualize what I'm trying to accomplish.

Basically, I want to:
-use VLOOKUP on A2:B4
-if the item exists and the price isn't empty, return the price
-if not found in A2:B4, or price is blank, check C2:D4
-if that fails, run a different set of calculations that are rather long and would likely exceed formula length if I have to input them multiple times into the same formula


I have a table that due to sizing issues, I've split in 2 and placed side by side.

To simplify things, I'll use a Fruit/Price example. Column A&C are Fruit, Column B&D are the price of the fruit in the previous column.

I need to complete a VLOOKUP on the fruit to return the price. If the fruit is listed without a price or if the fruit isn't listed at all, I have additional calculations to complete.

My problem is trying to create a formula that checks whether the VLOOKUP produces an error or returns a blank.

I've tried
=IF(OR(ISNA(VLOOKUP("ORANGE", A2:B4,2,FALSE)),VLOOKUP("ORANGE",A2:B4,2,FALSE)),"TRUE","FALSE")

While the first part of the OR statement is true, ORANGE isn't found in the vlookup, the formula returns #N/A because the second part of the formula fails. How do I get the OR to stop calculating at the first "TRUE" statement?

Ultimately, the idea is to do the same search on C:D and complete other calculations if that fails as well.

Any ideas would be appreciated!
 

Attachments

  • excel.PNG
    excel.PNG
    8.3 KB · Views: 6

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Duplicate to: VLOOKUP with IF OR returning N/A or BLANK

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,095
Latest member
nmaske

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