SharePoint Calculated Form - IF Statement

Tovy Thomas 26 Reputation points
2022-05-23T20:18:51.143+00:00

I'm using a list off the asset inventory template (Sharepoint Online) and have a column called serial number and realized I didn't have the computer name column which is derived with a fixed code + serial number.

I added a calculated column with single line of text as the result.

The formula originally was set to =("621-")&[Serial number]

This works great but as expected, this fills for all items (printers/docks etc.. ) which isn't needed.

So I took it a step further and went this way

=IF([Asset type]="Laptop",("621-")&[Serial number]) so it looks at the asset type and this is working but puts the word No in all other fields.

However, I need to add another qualifier to fit the first item so if the asset type is Laptop or Desktop, then it will be ("621-")&[Serial number] , or else just be blank.

I've tried multiple variations but keep getting syntax errors.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,561 questions
{count} votes

Accepted answer
  1. Jinwei Li-MSFT 4,721 Reputation points Microsoft Vendor
    2022-05-25T02:18:08.283+00:00

    Hi @Tovy Thomas ,

    Please try to use this:

    =IF(OR([Asset type]="Laptop",[Asset type]="Desktop"),("621-")&[Serial number],"")  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful