is this possible to achieve in google sheets?
if A2=“Bangkok” (vlookup (products!B1:F100) OR else if A2=“New York”(vlookup (products!M1:S100)
sure:
=IFERROR(IF(A2="Bangkok", VLOOKUP(A2, products!B1:F100, 2, 0),
IF(A2="New York", VLOOKUP(A2, products!M1:S100, 2, 0))))
A more concise version (given that your post indicates that A2 will only ever be either "Bangkok" or "New York"):
=IFERROR(VLOOKUP(A2,IF(A2="Bangkok",Products!B:F,Products!M:S),2,0))
However, I suspect that your real-world problem is more involved than this and yet perhaps easier to address more efficiently.
If you'd like, share a link to your sheet (or a copy of it) and explain in more detail the full end goal, and either I or another contributor here may very well be able to offer a more comprehensive approach.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.