Formula to look at specific column/cell depending on the current month

Hello,

I want to create a dashboard widget that will show employee FTEs for the current month. I currently have a sheet (Capacity Plan) that list out the employee's name, and then has the assigned projects with FTE breakdown as child rows underneath. Then I have row that calculates the total for the month.

User:


For the widget, I would like to create a separate sheet with a formula that says "If the employee is Sarah and the month is January look at this cell in the JAN 23 column, If the employee is Sarah and the month is February look at this cell in the FEB 23 column..."

I wasn't sure if I could use an IF + VLOOKUP or INDEX/MATCH.

User:


If it's no possible, I welcome any other suggestion to avoid having to manually change the cell link every month. It's not the end of the world, but the more I can automate, the better!

Thank you in advance!

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Are you wanting to pull for the current month?

  • kelceyg
    kelceyg ✭✭✭

    Yes, I would like to pull the current month's allocations for each team member. I am hoping there is a way that a formula can do this automatically so I don't have to update something manually each time they're assigned a new project or at the beginning of each month.

    I would then have it feed a widget on the dashboard to show the team member's name and their current allocation.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    You would use something like this:

    =INDEX({Range Covering Jan 23 - Dec 23 Columns}, MATCH([Employee Name]@row, {Column TO Match Employee Name In}, 0), MONTH(TODAY()))

  • kelceyg
    kelceyg ✭✭✭

    Hi Paul,

    I tried using the formula you suggested, but it didn't bring back anything.

    =INDEX([JAN 23]:[DEC 23], MATCH([Project Name]@row, [Project Name]:[Project Name], 0), MONTH(TODAY()))

    I think it might have to with the rows I had hidden. Here's a full view of the sheet:

    2023-03-02_11-10-03.jpg


    另外,我不知道这个公式知道that for March, it needs to look at the Total Allocation cell in the MAR 23 column.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Where exactly are you putting this formula?

  • kelceyg
    kelceyg ✭✭✭

    I added a column and put it in the same row as Sarah's name (third row).

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Ah. Ok. Try this one:

    =指数(收集((1月23日):(12月23日)(项目名称):[Project Name], @cell = "Total Allocation", [Assigned To]:[Assigned To], @cell = [Project Name]@row), 1, MONTH(TODAY())

  • kelceyg
    kelceyg ✭✭✭

    I got the error Incorrect Argument Set.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    And that is to be expected because I didn't think it through all the way. My apologies. Try this one instead...

    =INDEX([JAN 23]:[DEC 23], MATCH("Total Allocation", [Project Name]:[Project Name], 0), MONTH(TODAY())


    If you have more than just Sarah on the same sheet though, we may need to try something a little different. Insert a helper column (it can be hidden after setting it up) and use this column formula:

    =INDEX([Jan 23]@row:[Dec 23]@row, 1, MONTH(TODAY())


    Then in the call you are wanting to have the actual output in you would use:

    =INDEX(CHILDREN([Helper Column]@row), MATCH("Total Allocation", CHILDREN([Project Name]@row), 0))

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out theFormula Handbook template!
If your column title contains a space, it must be surrounded with square brackets. This should fix it.<\/p>

=COUNTIFS(PNS@row, 1) + COUNTIFS(EIP@row, 1) + COUNTIFS(Facilities@row, 1) + COUNTIFS([Patient Care Experience]@row, 1)<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":109375,"type":"question","name":"Calculate number of days and years from start date","excerpt":"I need to see how long staff have been with us, their tenure. I need this for any given dates, meaning \"today\". I have the start date, how do I get the days from that in years and days? Example: Start date is 06\/01\/2020, today is 08\/23\/2023 so the Tenure should be 3 years, 2 months, 22 days. I would take 3.2","snippet":"I need to see how long staff have been with us, their tenure. I need this for any given dates, meaning \"today\". I have the start date, how do I get the days from that in years and…","categoryID":322,"dateInserted":"2023-08-24T01:42:08+00:00","dateUpdated":null,"dateLastComment":"2023-08-24T15:05:11+00:00","insertUserID":82351,"insertUser":{"userID":82351,"name":"Leann Gibson","url":"https:\/\/community.smartsheet.com\/profile\/Leann%20Gibson","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/drupal_profile\/files\/2019-04\/7e\/c6\/n7ec6db531603daaefab20990ddcfdd53.jpg","dateLastActive":"2023-08-24T17:16:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"updateUserID":null,"lastUserID":82351,"lastUser":{"userID":82351,"name":"Leann Gibson","url":"https:\/\/community.smartsheet.com\/profile\/Leann%20Gibson","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/drupal_profile\/files\/2019-04\/7e\/c6\/n7ec6db531603daaefab20990ddcfdd53.jpg","dateLastActive":"2023-08-24T17:16:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":44,"score":null,"hot":3385732039,"url":"https:\/\/community.smartsheet.com\/discussion\/109375\/calculate-number-of-days-and-years-from-start-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109375\/calculate-number-of-days-and-years-from-start-date","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109375,"commentID":392349,"name":"Re: Calculate number of days and years from start date","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392349#Comment_392349","dateInserted":"2023-08-24T15:05:11+00:00","insertUserID":82351,"insertUser":{"userID":82351,"name":"Leann Gibson","url":"https:\/\/community.smartsheet.com\/profile\/Leann%20Gibson","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/drupal_profile\/files\/2019-04\/7e\/c6\/n7ec6db531603daaefab20990ddcfdd53.jpg","dateLastActive":"2023-08-24T17:16:24+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-24T15:05:21+00:00","dateAnswered":"2023-08-24T15:05:11+00:00","acceptedAnswers":[{"commentID":392349,"body":"

That worked perfectly, thank you!!<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":109369,"type":"question","name":"INDEXING and Validating","excerpt":"I have a perplexing question, that I am sure someone knows and I am missing here. I am working on a sheet to gather data from a form. However, this form will get quite lengthily and may span multiple years. With that said this is where I am stumped. =INDEX(COLLECT({Test Sheet 1 Range 1}, {Test Sheet 1 Range 1}, <> \"//www.santa-greenland.com/community/discussion/99898/\"),…","snippet":"I have a perplexing question, that I am sure someone knows and I am missing here. I am working on a sheet to gather data from a form. However, this form will get quite lengthily…","categoryID":322,"dateInserted":"2023-08-23T21:21:49+00:00","dateUpdated":null,"dateLastComment":"2023-08-24T14:04:04+00:00","insertUserID":163519,"insertUser":{"userID":163519,"name":"Frank Hammond","title":"Mr.","url":"https:\/\/community.smartsheet.com\/profile\/Frank%20Hammond","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/nWVKDFTEFOKBN.png","dateLastActive":"2023-08-24T15:23:34+00:00","banned":0,"punished":0,"private":false,"label":"✭✭"},"updateUserID":null,"lastUserID":163506,"lastUser":{"userID":163506,"name":"JamesB","title":"IT Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/JamesB","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/nEQMY42MFGXWS.png","dateLastActive":"2023-08-24T18:14:37+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":48,"score":null,"hot":3385713353,"url":"https:\/\/community.smartsheet.com\/discussion\/109369\/indexing-and-validating","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109369\/indexing-and-validating","format":"Rich","lastPost":{"discussionID":109369,"commentID":392314,"name":"Re: INDEXING and Validating","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392314#Comment_392314","dateInserted":"2023-08-24T14:04:04+00:00","insertUserID":163506,"insertUser":{"userID":163506,"name":"JamesB","title":"IT Project Manager","url":"https:\/\/community.smartsheet.com\/profile\/JamesB","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/avatarstock\/nEQMY42MFGXWS.png","dateLastActive":"2023-08-24T18:14:37+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-23T21:50:04+00:00","dateAnswered":"2023-08-23T21:43:36+00:00","acceptedAnswers":[{"commentID":392246,"body":"

@Frank Hammond<\/a> <\/p>

Your formula is close, looks like you just need commas between your criterion range and criterion.<\/p>

=INDEX(COLLECT({Test Sheet 1 Range 1}, {Test Sheet 1 Range 2}, = 9, {Test Sheet 1 Range 3}, = 2023), Index@row)<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Formulas and Functions