Index formula versus If And

maineL
maineL ✭✭
edited 06/14/23 inFormulas and Functions

Hi,

First time posting. I have several sheets I link together. Long story short is web applications pasted into one sheet populate into another for vetting for eligibility of employment. That sheet will then provide the data for my drop downs into the Active Sheet which will pull the corresponding rows of data based on the person's name. All that is working. I'm now trying to create a formula from a "helper sheet" where I have fall and spring stipends that I would like to populate based on whether F or S is selected and if the course is 15 or 20 hours for the semester.

image.png
image.png

我一直在使用索引,但我想我可以use the If And formula, but unsure of how to make it work. This is the index formula I've been using, which works, but if I have someone who is only TA'ing in the Fall, I want the spring stipend column to remain blank and same for spring TA'ing and leaving fall blank.

=INDEX({UpdateRates 15Stipend}, MATCH([email protected], {UpdateRates Term}, 0))

image.png

Any ideas what I might be doing wrong?

Thanks so much!

Lori

Best Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    Right. You'll need to change the very first "S" to an "F" in the Fall column.

    thinkspi.com

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    Right. You do not need 4 separate formulas. There is no need to break out the 15 hours and 20 hours into separate columns. The formula I provided already accounts for that using the bold portion:

    =IF([email protected]= "F", INDEX(IF([email protected]= 15, {UpdateRates 15Hrs}, {20 Hour Column}), MATCH([email protected], {UpdateRates Term}, 0)))


    That IF statement is telling the formula to look in either the 15 hour column of the reference sheet or the 20 hour column of the reference sheet depending on what is in[email protected]问题是,{20小时列}交叉表reference has not yet been created in your sheet.

    thinkspi.com

«1

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    I am assuming that the far left column in the second screenshot is the one designating F/S. Is it possible it could be both?

    thinkspi.com

  • maineL
    maineL ✭✭

    Sorry I hit yes answered. Yes the Term column on the far left is the F/S column. No it can only be one or the other.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 06/14/23

    Ok. I will first suggest putting the dollar amounts in the 20 hours column in your first screenshot on the same row as the dollar amounts in the 15 hours column.


    Term ..... 15H ..... 20H

    F..............$$..........$$

    S..............$$..........$$


    Then you can use something like this in the Spring Stipend column and then just change that first "S" to an "F" for the Fall Stipend column:

    =IF([email protected]= "S", INDEX(IF([email protected]= 15, {UpdateRates 15Stipend}, {20 Hour Column}), MATCH([email protected], {UpdateRates Term}, 0)))

    thinkspi.com

  • maineL
    maineL ✭✭

    That works for Spring 15 hours. I'm overthinking this. Looks like it's populating both 15 Stipend and 20 Stipend columns with the same dollar amount. If I change Term to F, the columns are blank. Which is what I want, but if S is selected, I want the F Stipend column to be blank.

    image.png

    nk. Does that make sense?

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    Right. You'll need to change the very first "S" to an "F" in the Fall column.

    thinkspi.com

  • maineL
    maineL ✭✭

    Perfect! Thank you so much!!!! That leads me to another question of getting the HRS column to change when the Course changes. I currently have this formula:

    =INDEX({Data RangeHrs}, MATCH([email protected], ({Data RangeClass})))

    But, it only seems to change when I select the End 1445 course.

    image.png

    The course selection and hours are on my Data "helper sheet":

    image.png

    I've tried several times and I'm unsure where I'm going wrong! Thank you so much for all of your help!!!!

    Lori

  • maineL
    maineL ✭✭

    So on the previous topic, The formula does work, but I'm trying to get it to do the following.

    Term F/S in their respective columns for Fstipend/Sstipend

    Hrs 15/20 to change to the correct dollar amount for the respective Stipend Column and dollar amount. Right now it's doing it for 20 hours in the spring stipend column, but not for 15 hours in the Spring column. I think I did something wrong?

    image.png

    In a perfect world, I'd like the Term and hours to populate the correct stipend column with the correct amount. I was hoping to do a formula for the column, but I'm guessing it will have to be a "cell" formula instead?

    Thanks again! Sorry for the roundabout!

    Lori

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    This should be working as a column formula but you need technically two separate formulas. One for the Spring column with the "S" at the beginning and one for the Fall column with the "F" at the beginning.


    Exactly what formula do you have in there that is producing the error and what error is it?

    thinkspi.com

  • maineL
    maineL ✭✭

    Ok, I'm back on this one. So the 15 or 20 hour rate is what I was hoping to get to appear in the correct column with the correct amount. So the page with the rates:

    image.png
    image.png

    And the formula I'm using is: =IF([email protected]= "S", INDEX(IF([email protected]= 15, {UpdateRates 15Hrs}, {20 Hour Column}), MATCH([email protected], {UpdateRates Term}, 0)))

    Is there a way to make the formula interchangeable based on the Hrs (15 or 20) so I can have it autopopulate or should I set up 2 columns for Fall (15 & 20) and Spring?

    Thank you!

    Lori

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    That is what the bold piece below is doing:

    =IF([email protected]= "S", INDEX(IF([email protected]= 15, {UpdateRates 15Hrs}, {20 Hour Column}), MATCH([email protected], {UpdateRates Term}, 0)))


    Although in your previous screenshots the 15 and 20 were right justified in their cells (indicative of numerical values), but in your most recent screenshot they are left justified (indicative of text strings). Did you apply any kind of formatting to this column?

    thinkspi.com

  • maineL
    maineL ✭✭

    Oh, yes I tried to align everything to the left. Would that make a difference? I can set it back to right justification. So based on the formula above, I won't be able to autopopulate the column as there are 2 separate formulas. Would this work if I created the extra columns (one for 15 hours F and S and one for 20 hours F and S)?

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 06/15/23

    If you adjusted the formatting then there is no issue. If you had not done anything with the formatting then we may have had to tweak the formula a little bit.


    You can apply the above as a column formula in the Spring column. The "two separate formulas" are one for Spring and one for Fall. Both should be able to be applied as column formulas. One goes in the Spring column and the other goes in the Fall column (after changing the s to an f).

    thinkspi.com

  • maineL
    maineL ✭✭

    So that worked for the Spring column, but in changing the F to the Fall Column, I get Invalid Ref:

    =IF([email protected]= "F", INDEX(IF([email protected]= 15, {UpdateRates 15Hrs}, {20 Hour Column}), MATCH([email protected], {UpdateRates Term}, 0)))

    image.png


  • maineL
    maineL ✭✭

    I see it has something to do with the 20 hrs. If that helps?

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Make sure you set up the {20 Hour Column} cross sheet reference correctly.

    thinkspi.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out theFormula Handbook template!
Hi @Sam Swain<\/a>,<\/p>

You should be able to use this formula to accomplish this:<\/p>

=IF(HAS([Type of Project]@row, \"Consolidation\"), \"🝢\", \"//m.santa-greenland.com/community/discussion/comment/\") + IF(HAS([Type of Project]@row, \"Reduction\"), \"︾\", \"//m.santa-greenland.com/community/discussion/comment/\") + IF(HAS([Type of Project]@row, \"New\"), \"○\", \"//m.santa-greenland.com/community/discussion/comment/\") + IF(HAS([Type of Project]@row, \"Termination\"), \"⨷\", \"//m.santa-greenland.com/community/discussion/comment/\")<\/p>

Example output:<\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n

Hope this helps - if there are any issues etc. then just post! ☺️<\/span><\/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":106930,"type":"question","name":"Help with date formate","excerpt":"I have my months extracted from a date column using =Left(EISD@row,2) I need a formula to evaluate my month column, if it's 01-06 it returns an S, if its 07-12 (or <=7) then it returns an F.","categoryID":322,"dateInserted":"2023-06-26T22:42:11+00:00","dateUpdated":null,"dateLastComment":"2023-06-27T12:53:54+00:00","insertUserID":157924,"insertUser":{"userID":157924,"name":"jpaul","title":"Mr.","url":"https:\/\/community.smartsheet.com\/profile\/jpaul","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/34U84XEA80NI\/nJBANQUTUTY9A.png","dateLastActive":"2023-06-27T12:53:25+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"updateUserID":null,"lastUserID":157924,"lastUser":{"userID":157924,"name":"jpaul","title":"Mr.","url":"https:\/\/community.smartsheet.com\/profile\/jpaul","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/34U84XEA80NI\/nJBANQUTUTY9A.png","dateLastActive":"2023-06-27T12:53:25+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":18,"score":null,"hot":3375690965,"url":"https:\/\/community.smartsheet.com\/discussion\/106930\/help-with-date-formate","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106930\/help-with-date-formate","format":"Rich","lastPost":{"discussionID":106930,"commentID":382517,"name":"Re: Help with date formate","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382517#Comment_382517","dateInserted":"2023-06-27T12:53:54+00:00","insertUserID":157924,"insertUser":{"userID":157924,"name":"jpaul","title":"Mr.","url":"https:\/\/community.smartsheet.com\/profile\/jpaul","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/34U84XEA80NI\/nJBANQUTUTY9A.png","dateLastActive":"2023-06-27T12:53:25+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-27T12:53:24+00:00","dateAnswered":"2023-06-26T23:07:25+00:00","acceptedAnswers":[{"commentID":382460,"body":"

Assuming your result will only ever be 01-12, this should do the trick. The VALUE() function may not necessarily be needed, but I'm not sure what type of date you are pulling the month information from and it isn't going to hurt anything.<\/p>

=IF([Month Column]@row <> \"//m.santa-greenland.com/community/discussion/comment/\", IF(VALUE([Month Column]@row) < 7, \"S\", \"F\"))<\/p>

Replace [Month Column] with your column name.<\/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":[]},{"discussionID":106913,"type":"question","name":"SUMIF with a checkbox","excerpt":"I'm trying to sum a row of amounts (Parking Revenue Regular:Private boat parking revenue) into the column \"Total Parking Revenue\", but only if the checkbox \"Payment Voucher\" isn't checked. When I add the rows using this formula without the checkbox, it works (formula on first row only): =SUM([Parking Revenue…","categoryID":322,"dateInserted":"2023-06-26T18:20:45+00:00","dateUpdated":null,"dateLastComment":"2023-06-26T19:03:27+00:00","insertUserID":162776,"insertUser":{"userID":162776,"name":"declark","title":"Regional Director","url":"https:\/\/community.smartsheet.com\/profile\/declark","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!4cFWuLGjTPw!x-tXMZGznvw!Dlin9vWXHb9","dateLastActive":"2023-06-26T19:03:36+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":162776,"lastUser":{"userID":162776,"name":"declark","title":"Regional Director","url":"https:\/\/community.smartsheet.com\/profile\/declark","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!4cFWuLGjTPw!x-tXMZGznvw!Dlin9vWXHb9","dateLastActive":"2023-06-26T19:03:36+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":30,"score":null,"hot":3375611052,"url":"https:\/\/community.smartsheet.com\/discussion\/106913\/sumif-with-a-checkbox","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106913\/sumif-with-a-checkbox","format":"Rich","lastPost":{"discussionID":106913,"commentID":382400,"name":"Re: SUMIF with a checkbox","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382400#Comment_382400","dateInserted":"2023-06-26T19:03:27+00:00","insertUserID":162776,"insertUser":{"userID":162776,"name":"declark","title":"Regional Director","url":"https:\/\/community.smartsheet.com\/profile\/declark","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!4cFWuLGjTPw!x-tXMZGznvw!Dlin9vWXHb9","dateLastActive":"2023-06-26T19:03:36+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/3KE67LQDZX4M\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-26T19:03:34+00:00","dateAnswered":"2023-06-26T18:31:26+00:00","acceptedAnswers":[{"commentID":382384,"body":"

Try IF([payment voucher]@row=0,Sum([Parking Revenue Regular]@row:[Private boat parking revenue]@row),\"//m.santa-greenland.com/community/discussion/comment/\")<\/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