Notion Formulas: The Versatile if() Function

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ก.ย. 2024
  • The if() function is among the most versatile and widely used functions in Notion and spreadsheet tools. By allowing you to return values based on specified conditions, it bolsters your ability to automate properties and streamline your workflow.
    This video presents the fundamentals of if(), then explores a few practical examples whose principles can be applied widely.
    // ----- //
    💡 HELPFUL RESOURCES
    Template: market.notion....
    Notion VIP Post: www.notion.vip...
    The Notion Formula Cheat Sheet: notion.vip/for...
    Meet Notion's Formula Property: www.notion.vip...
    William on Twitter: / williamnutt
    Subscribe to Notion VIP: notion.vip
    // ----- //
    👋 MEET WILLIAM
    William Nutt is the founder of Nutt Labs, an integrated digital strategy firm and Notion consultancy. As a foremost Notion expert, he hosts Notion's webcast for teams, Notion at Work, and runs the authoritative website Notion VIP (notion.vip), where he publishes tools and insights for Notion users.
    // ----- //
    🎧 CREDITS
    Background Music: icons8.com/mus...
    // ----- //
    #Notion #Productivity

ความคิดเห็น • 59

  • @sonsenvrac945
    @sonsenvrac945 2 ปีที่แล้ว +7

    Sometimes Notion is so simple than it take me a while to simplifie my thoughts about how i can to my stuff. So thanks to you guys i'm on the road to a simplier and easier life. Great tutorial, thanks!

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว

      Glad to hear it. Thank you.

  • @g-ann3527
    @g-ann3527 3 ปีที่แล้ว +4

    Thanks for this! The pasting-to-browser trick is pretty helpful!

  • @MiPo3333
    @MiPo3333 ปีที่แล้ว +1

    Brilliant tutorial. The code block makes it so much easier to understand and follow. And the delivery otherwise is great as well. Thank you.

    • @WilliamNutt
      @WilliamNutt  ปีที่แล้ว

      Thanks so much. Indeed, I love composing in the code block. Be sure to watch my more recent formula-focused guides.

  • @mric4069
    @mric4069 3 ปีที่แล้ว +1

    This was really helpful. Thank you!

  • @aluizaoliveira_
    @aluizaoliveira_ 2 ปีที่แล้ว +1

    oh my god! this is so helpful. thank you so much. i’ve been trying to organize my grades & assignments and you gave me all the answers i needed.
    i’ll make sure to subscribe!!💞

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว

      Glad to hear it. Thanks Luiza.

  • @brokeforever
    @brokeforever 2 ปีที่แล้ว +1

    Is there an easy way to count for example the Important and Not Important entries in the Importance section? I'd like to have a separate section which shows how many entries are Important and how many are Not Important

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว

      Thanks for the Q. If you *Group* by the *Importance* property, you can count the number of items in each group. You could also create a view that's filtered to display only "Important" items, which you can count.

  • @crystalcraig
    @crystalcraig 2 ปีที่แล้ว +1

    This is great. Is there a formula to change the text colour? Let's say we have a stock chart. Properties are: "My Investment", "Market Value", "Change". The change is a formula to show if a certain stock is at a loss or gain. It's prop("Investment") - prop("Market Value"). What would I have to add to the formula to show a negative loss in the colour red and a positive gain in green? Is it even possible?

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว +1

      Thanks Crystal. Coloring is currently unsupported by Formula properties. It's a feature many users are eager to see, so I suspect it's on the roadmap.

    • @crystalcraig
      @crystalcraig 2 ปีที่แล้ว +1

      @@WilliamNutt Good to know. Thanks. :)

  • @TatyCL89
    @TatyCL89 2 ปีที่แล้ว +4

    Is there a way to use the if() to atribute colored texts to conditions?
    For instance, if the number is >6 it says "Pass" in green and "Fail" in red?

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว +2

      Great question. Not yet, unfortunately, but I'm confident we'll see conditional formatting at some point.

    • @TatyCL89
      @TatyCL89 2 ปีที่แล้ว +2

      @@WilliamNutt Thank you so much for the fast reply! Cant wait to have it as an option :)

  • @hyunhojung8675
    @hyunhojung8675 3 ปีที่แล้ว +1

    Tremendous help. Many thanks.

  • @lucavervoort5475
    @lucavervoort5475 3 ปีที่แล้ว +3

    I was trying to design an Eisenhower matrix by myself, and randomly fell on your video while looking for help. I was wondering if it was possible to have the same type of outcome from a multi-select property instead of 2 select properties (where if the multi-select properties contains "Important" and "Urgent", return "Do", if it contains "Important" and "Non Urgent", return "Schedule" etc)

    • @WilliamNutt
      @WilliamNutt  3 ปีที่แล้ว

      Thanks Luca. Absolutely - you'd just need to add additional conditions to the formula that generates the outcome. If you're unfamiliar with formulas, this may help: www.notion.vip/meet-notions-formula-property/

    • @sylvonlama
      @sylvonlama ปีที่แล้ว

      Hi Luca, I was trying the same but was unable to do so. Were able to figure out how to put multiple IF statements?

  • @Luxxen101
    @Luxxen101 3 ปีที่แล้ว +1

    Excellent! Thanks!

  • @danielcondor5534
    @danielcondor5534 2 ปีที่แล้ว +1

    Hello, I was looking for information about the if function and luckily I found your video, thank you very much. And a question arose in me: is it possible to put a condition and that according to it do an operation?

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว +1

      Thanks Daniel. That's precisely what if() does: tests for a condition, then returns a value (sometimes resulting from an operation) based on the test.

    • @danielcondor5534
      @danielcondor5534 2 ปีที่แล้ว +1

      @@WilliamNutt Thanks William

  • @rickdee888
    @rickdee888 3 ปีที่แล้ว +1

    William, for the "pass" and "fail", how am I able to color green for pass and red for fail in the "IF" formula?

    • @WilliamNutt
      @WilliamNutt  3 ปีที่แล้ว

      You cannot currently color the output of functions, unfortunately.

  • @kustomkure
    @kustomkure ปีที่แล้ว +1

    Thanks for the video. Quick question. Is there a way to show only specific values in a cell? Let's say a property has 10 values. I want to have a column showing only specific values based on certain rules. Is it possible through if()?

    • @WilliamNutt
      @WilliamNutt  ปีที่แล้ว

      Yes, that's exactly what if() does.
      If you specify the conditions and values, I'll be happy to construct the formula.

    • @kustomkure
      @kustomkure ปีที่แล้ว +1

      @@WilliamNutt Thanks for the reply. Let me try to explain it.
      So, I have 2 databases. db1 (Ingredients) and db2 (Recipes). The two are interconnected through Relation. So recipes are shown in ingredients and vice versa. So multiple recipes are shown for every ingredient.
      In db2 I have prop1 (checkbox "added for this week"). When I mark it, it means that this recipe is picked for this week. I then add this prop1 as Rollup in db1.
      Now, for the next step in db1 (Ingredients) I create a view named "This week". In this view I need to see:
      1. List of ingredients used ONLY for "this week" recipes (this I managed to solve through filtering of that prop1)
      2. And (this is where I have a problem) for every ingredient I need to see ONLY the recipes marked "for this week" (instead of all the recipes this ingredient is used in) to basically see how much I need to buy for this week.
      So basically in db1 I need to create an if() function to show me specific recipes from db2 filtered by prop1 from that db2. That's where my brain started to hurt.
      Hope this was clear enough 😀

    • @WilliamNutt
      @WilliamNutt  ปีที่แล้ว

      @@kustomkure Your best option is a "This Week" view of Recipes *within* the Ingredient template. There, you can filter it for recipes Related to that ingredient and checked "This Week."
      Displaying those items within a property would require elaborate formula work with excess properties.

  • @devikumar2609
    @devikumar2609 2 ปีที่แล้ว +2

    Thank you so much for this amazing and easy to understand explanation 🙏🏻😊

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว +1

      My pleasure. I have many other formula videos published, and Notion A-to-Z will teach them in a particularly effective way: premier.notion.vip/a-to-z

  • @PeterOlle
    @PeterOlle 3 ปีที่แล้ว +1

    Good stuff, thank you!

  • @StrongImaginationA
    @StrongImaginationA 2 ปีที่แล้ว +1

    What if I want one column to return a value only if 4 other columns have a checked checkbox? I can't seem to find the correct way of coding this. Do I work with nested if() functions or do I need to work with the and() function?

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว

      Thanks for the question. You can approach this in a few ways, including various combinations of IF() and AND(). Remember that AND() only accepts two arguments, so you'd need to use AND(AND(), AND()).
      Your most straightforward approach is to stick to nested IF() functions:
      IF(prop("Checkbox 1"), IF(prop("Checkbox 2"), IF(prop("Checkbox 3"), IF(prop("Checkbox 4"), "Value for All Trues", "Value for Any Falses"))))

  • @madmat8825
    @madmat8825 2 ปีที่แล้ว +1

    Thank U for help!

  • @SLiX-thatguy11m-
    @SLiX-thatguy11m- 2 ปีที่แล้ว +1

    Is it possible to use an if function to output a page through relation? Like an if function, that depending on the criteria, will show a specific page for the value

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว

      You cannot establish relations with formulas. You can with automation tools like Automate.io and Integromat, however: www.notion.vip/advanced-notion-automation-with-integromat/

  • @tajmathakiya
    @tajmathakiya 3 ปีที่แล้ว +1

    Hey, Willian What if we want to apply a formula that shows who is ranked 1st, 2nd, 3rd, and so on automatically ? is that possible?

    • @WilliamNutt
      @WilliamNutt  3 ปีที่แล้ว

      How is the ranking determined?

    • @tajmathakiya
      @tajmathakiya 3 ปีที่แล้ว

      @@WilliamNutt in the video Cam Newton has scored 96% so he will be shown as First Rank then Matt Stafford has 84% as Second Rank and Tom Brady as the Third Rank.

    • @WilliamNutt
      @WilliamNutt  3 ปีที่แล้ว +1

      @@tajmathakiya Got it. Not doable, unfortunately, but you could sort by the Score property.

    • @tajmathakiya
      @tajmathakiya 3 ปีที่แล้ว +1

      @@WilliamNutt Ok, Thanks for the help!

  • @generationsarising
    @generationsarising ปีที่แล้ว

    I'm having a hard time getting the correct formula. Can you look at what I have and tell me how to fix it? "if(and(prop("Category 2") == "❓ Quiz")), if(empty(prop("PASS / FAIL"))), true)".

    • @WilliamNutt
      @WilliamNutt  ปีที่แล้ว

      I'd need to more context in order to help, sorry. I recommend contacting Notion's support team via the `?` at the bottom of the app.

  • @faroalislami9114
    @faroalislami9114 2 ปีที่แล้ว +1

    how there is checkbox in if steatment??

    • @WilliamNutt
      @WilliamNutt  2 ปีที่แล้ว

      Notion represents true and false with checkboxes. If your formula returns true, it will show a checked checkbox; otherwise it will show an unchecked checkbox.

  • @rafaellincoln6710
    @rafaellincoln6710 3 ปีที่แล้ว

    Hi William, how are you? I'm trying to put this formula on, but Notion shows me that is to many arguments in the function. How can I solve this? Thanks for the support!

    • @WilliamNutt
      @WilliamNutt  3 ปีที่แล้ว

      Thanks Rafael. I'd need to see the specific formula and database, but I recommend that you reference the template: market.notion.vip/item/the-versatile-if-function/

  • @MiguelCoutoSilva
    @MiguelCoutoSilva 9 หลายเดือนก่อน

    Really good tutorial but the Priority formula isn't working for me, getting this feedback:
    "Function if expects 3 arguments, but only 2 were provided. [0,64] Expected token ")". [277,278] End of input expected. [437,438]"

    • @MiguelCoutoSilva
      @MiguelCoutoSilva 9 หลายเดือนก่อน

      this is what i have:
      if(
      prop("Importance") == "Important",
      if(
      prop("Urgency") == "Urgent",
      "4",
      "3"
      )
      if(
      prop("Urgency")=="Urgent",
      "2",
      "1"
      )
      )

    • @MiguelCoutoSilva
      @MiguelCoutoSilva 9 หลายเดือนก่อน

      Solved (in case anyone had a similar problem)
      had it corrected with this:
      if(prop("Importance") == "Important", (if(prop("Urgency") == "Urgent",4,3)), (if(prop("Urgency")=="Urgent",2,1)))

    • @WilliamNutt
      @WilliamNutt  9 หลายเดือนก่อน +1

      Thanks so much. Since publishing this guide, Notion overhauled formulas with "Formulas 2.0." I cover it in Notion A-to-Z and hope to publish updated guides in 2024.

    • @MiguelCoutoSilva
      @MiguelCoutoSilva 9 หลายเดือนก่อน

      @@WilliamNutt yeah, i would love if they allowed to pull numbers from the entire column like some or average for example to use in another column formula. Until now the solutions for that are a bit unpractical

    • @WilliamNutt
      @WilliamNutt  9 หลายเดือนก่อน

      Coda exemplifies how Notion formulas can work. They can reference, any value, anywhere. You can also write them anywhere, including in-line.

  • @idkkk9223
    @idkkk9223 3 ปีที่แล้ว

    i have a question

  • @2sidetales749
    @2sidetales749 ปีที่แล้ว

    Jesus William you need a new mic

    • @WilliamNutt
      @WilliamNutt  ปีที่แล้ว

      Thanks. Got one. This video is three years old.