Applying Formulas to Entire Columns

ichen
ichen ✭✭
edited 12/09/19 in Smartsheet Basics

Hello there,

I'm new to the community. Our company has adopted SS for projects and we're now looking to expand the use to HR, specifically starting with leave requests.

I've started a leave request sheet based on the template below, with a few adjustments geared toward my company.

https://community.smartsheet.com/discussion/here-time-keeping-smartsheet

So far, this template is a great starting point. Now I want to enhance my template by adding simple formulas to an entire column. The problem I'm coming across is that these formulas don't apply to new rows added via web forms.

Β For example - see image below:

  1. I'd like my Total Days Off Request column to auto-calculate the number of days off that an individual is requesting based on the sum of the Vacation Leave | Sick Leave | In-Lieu Leave | Bereavement Leave | Parental Leave | LeaveΒ  without Pay columns
    • Take a look at row two where an individual has requested for Bereavement Leave (3 days) and additional Vacation Leave (2 days), a total of 5 days off requested
  2. Second, I'd like my Remaining Eligible Vacation Days updated once the Status is changed to Approved by subtracting Current Eligible Vacation Days from Vacation Leave
    • I'd like to apply a similar concept to Sick Leave as well

Β 

Perhaps you have some tricks up their sleeves or a workaround for my above roadblock?

I'm also open to any suggestions that may have worked for you and your company.

Β 

SS-Leave Request.jpg

Comments

  • L_123
    L_123 Community Champion

    you could just add them individually

    Β 

    =[Vacation Leave]@row+Β [Sick Leave]@row +Β [In-Lieu Leave]@row +Β [Bereavement Leave]@row+Β [Parental Leave]@row +Β [LeaveΒ  without Pay]@row

    or even use a sum formula across the range

    =sum([Vacation Leave]@row:[Leave Without Pay]@row)

    Β 

    Or something similar

    Β 

    for the second part just subtract them

    Β 

    =[Current Eligible Vacation Days]@row - [Total Days Off Request]@row

  • ichen
    ichen ✭✭

    Thanks for your reply.Β 

    That's exactly what I have set up, but I noticed that if there was a new line added (via web form) to theΒ topΒ of the list, the formula doesn't apply. However,Β  if the new line is added to theΒ bottomΒ of the list, it appears to be working...Β 



    It's not as convenient as the leave request list begin to grow - and the need to scroll all the way to the bottom of the list as opposed to it appearing with the formulas applied atΒ the top of the list.Β 

    It's still a work around for the time being though.Β 

    Thanks agains!Β 

  • AndrΓ©e StarΓ₯
    AndrΓ©e StarΓ₯ Community Champion

    Hi,

    To make it easier to handle you could use filters on the sheet or use a report.

    I hope this helps you!

    Have a fantastic week!

    Best,

    AndrΓ©e StarΓ₯

    Workflow Consultant @ Get Done Consulting

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    AndrΓ©e StarΓ₯ | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E: andree@workbold.com | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.

  • eric.o
    eric.o Employee

    Hi Ichen,

    1. If you'd like formulas to automatically add to newly added rows, Smartsheet currently automatically achieves utilizing the native tool Autofill. Autofill for formulas is applied when specific conditions exist in the sheet. If you're finding your Autofill isn't working it's likely not triggering one of the following conditions outlined here:Β https://help.smartsheet.com/articles/1641473-auto-filling-formulas-and-formatting

    Β 

    Note: You can change the location of new entries from a Form utilizing the steps outlined here:Β https://help.smartsheet.com/articles/522221-collect-information-form#manageform

    Β 

    2. Yes, Luke_TK is absolutely right in achieving the first formula calculation. The most efficient way to achieve this is by utilizing a SUM function.Β https://help.smartsheet.com/function/sum

    =SUM([Vacation Leave]@row:[Leave Without Pay]@row)

    Β 

    3. If you'd like Remaining Eligible Vacation Days to update once Status is changed to Approved by subtracting Current Vacation Days from Vacation Leave, you can achieve this utilizing an IF Function.Β https://help.smartsheet.com/function/if

    Β 

    Such as this:

    =IF(Status@row="Approved", [Current Eligible Vacation Days]@row - [Total Days Off Request]@row)

    Β 

    Cheers,Β 

    Eric Β 

    Smartsheet Support