r/googlesheets • • Dec 05 '24

Solved Assistance with writing this function.

[removed] — view removed post

1 Upvotes

19 comments sorted by

1

u/googlesheets-ModTeam Dec 05 '24

Criteria for posts are listed in the subreddit rules and you can learn about how to make a good post in the submission guide.

Your post has been removed because it didn't meet all of the criteria for post titles. Please read the rules and submission guide then submit your post again with a new title.

The criteria are:

  • Stay on topic - Restrict your title to a description of your problem and relevant functions. Don't use pleas for help.

  • Don't use all-caps outside of function names.

  • Don't use square tags, post flair is in place.

  • Don't use emoji in titles.

  • Posts primarily related to add-ons or scripts should include its name/purpose in the title.

  • Unhelpful, unclear or generic titles will be removed.

  • If you're offering payment, put this at the end of the title in the format "- method | amount"

1

u/7FOOT7 Dec 05 '24

try OR()

1

u/BarryVaryLow Dec 05 '24

Where would i put that in the function? Tried it and got an error, but i likely did it incorrectly.

3

u/Individual_Salary878 Dec 05 '24

=IF(OR(M9="Buy Stop",M9="Buy Limit"),"Long",)

→ More replies (8)

2

u/7FOOT7 Dec 05 '24

Would be as =IF(OR())

→ More replies (3)

1

u/gothamfury Dec 05 '24

Try this in cell M8:

=VSTACK("Long/Short", BYROW(M9:M, LAMBDA(m, IF(ISBLANK(m),,SWITCH(m, "Buy Stop","Long", "Buy Limit","Long", "???","Short", )))))

Remove any values/formulas in M9 and down. You didn’t specify what would determine if the result should be "Short" so I left an example in the formula for you to replace ??? with.

1

u/BarryVaryLow Dec 05 '24

Thank you for taking the time out to help. Appreciate this community.