SOLVED

Mutiple formulas in 1 cell

Copper Contributor

how do you write mutilple formulas for 1 cell. example (in one cell if the number is 5 then i want it to input in another cell the number 1 OR if the number in that same cell is 4 then i want it to input in another cell the number 2 and so on.

15 Replies

@Budwizer_10 A cell can only hold one formula, but it can have many different outcomes. On the other hand, multiple formulae can reference one particular cell.

 

If you could upload a schedule that gives a clear example of what you are dealing with, that would be helpful.

@Budwizer_10 

Spreadsheets provide a functional, rather than imperative, programming style.  That means they are specifically designed to prevent a value/cell being changed as a result of executing one or more instructions held elsewhere.

 

Rather than looking at the value in a cell and thinking "What do I want to happen as a result of this?", focus on the other cells and ask "How do I determine the value of this cell"

 

Hi there, thanks so much for the response. Here is a copy of what i am trying to do.
This table is for a golf game and basically on hole 1 if par is a 4 and Greg scores a 6 he should get 0 points, if he scores a 5 he should get 1 point and he scores a 4 then 2 points and if he scores a 3 then gets 3 points. I am trying to input the mutiple what if formula into where the Points total (1) is and retreive the data from where Greg inputs his score (5)
Hole 1 Hole 2 Hole 3 .........etc
Par 4 5 3
Greg 5 4 4
Points 1
Not sure if this is possible but any further help would be very much appreciated.

Hi there, thanks so much for the response. Here is a copy of what i am trying to do.
This table is for a golf game and basically on hole 1 if par is a 4 and Greg scores a 6 he should get 0 points, if he scores a 5 he should get 1 point and he scores a 4 then 2 points and if he scores a 3 then gets 3 points. I am trying to input the mutiple what if formula into where the Points total (1) is and retreive the data from where Greg inputs his score (5)
Hole 1 Hole 2 Hole 3 .........etc
Par 4 5 3
Greg 5 4 4
Points 1
Not sure if this is possible but any further help would be very much appreciated.

@Budwizer_10 No problem. See attached workbook for a working example based on your description. But I suspect that your next question will be to include course rating, multiple players, stroke index, handicap and playing handicap.

 

In the attached file you'll find two solution. One with new Excel functions and one with an "old-style" approach.

@Riny_van_Eekelen 

I liked the 365 solution!  Since you have the situation under control, I set out to play with Lambda functions.  I think it may be a while before I really get settled into the new ways of working and read the formulas fluently; they still don't look like spreadsheets to me.

image.png

Riny/van/Eekelen, thank you so much this is what i was looking for and it now makes sense, what you are saying. Excel is unable to create a mutiple formula in one cell so you have to create a data table to draw from for all the what ifs. Again thank you so much. Greg
Peter, I want to thank you also this gives me a better understanding of what i was looking for and it now makes sense, what you are saying. Excel is unable to create a mutiple formula in one cell so you have to create a data table to draw from for all the what ifs. Again thank you so much. Greg
One last question, Your spreadsheet works perfect but when I try to copy paste the scores and points values for all of 1 player to create another player the formulas do not work any longer. Am i missing something in the copying and pasting?

@Budwizer_10 Who's spreadsheet are you referring to? Easier if you upload your schedule so that either @PeterBartholomew1 or I can help you out.

Hi there, either yours or Peters i could not seem to copy paste to create another player. I am not sure how to upload a copy of mine otherwise i would. Where do i upload a copy. thx

@Budwizer_10 Below the box where you answer, you should see this:

Screenshot 2021-07-17 at 17.44.06.png

Just follow the instructions 🙂

best response confirmed by Budwizer_10 (Copper Contributor)
Solution

@Budwizer_10 OK, you went for a horizontal lookup table. Not sure if you can work with the newer functions so I added the "old-style" formulae, after changing the lookup table a bit. See attached.

Riny_van_Eekelen, I truly want to thank for your help, it works great and you have given me a better understanding of excel.
1 best response

Accepted Solutions
best response confirmed by Budwizer_10 (Copper Contributor)
Solution

@Budwizer_10 OK, you went for a horizontal lookup table. Not sure if you can work with the newer functions so I added the "old-style" formulae, after changing the lookup table a bit. See attached.

View solution in original post