SOLVED

Mutiple formulas in 1 cell

%3CLINGO-SUB%20id%3D%22lingo-sub-2553267%22%20slang%3D%22en-US%22%3EMutiple%20formulas%20in%201%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2553267%22%20slang%3D%22en-US%22%3E%3CP%3Ehow%20do%20you%20write%20mutilple%20formulas%20for%201%20cell.%20example%20(in%20one%20cell%20if%20the%20number%20is%205%20then%20i%20want%20it%20to%20input%20in%20another%20cell%20the%20number%201%20OR%20if%20the%20number%20in%20that%20same%20cell%20is%204%20then%20i%20want%20it%20to%20input%20in%20another%20cell%20the%20number%202%20and%20so%20on.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2555212%22%20slang%3D%22en-US%22%3ERe%3A%20Mutiple%20formulas%20in%201%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2555212%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1104591%22%20target%3D%22_blank%22%3E%40Budwizer_10%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESpreadsheets%20provide%20a%20functional%2C%20rather%20than%20imperative%2C%20programming%20style.%26nbsp%3B%20That%20means%20they%20are%20specifically%20designed%20to%20prevent%20a%20value%2Fcell%20being%20changed%20as%20a%20result%20of%20executing%20one%20or%20more%20instructions%20held%20elsewhere.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERather%20than%20looking%20at%20the%20value%20in%20a%20cell%20and%20thinking%20%22What%20do%20I%20want%20to%20happen%20as%20a%20result%20of%20this%3F%22%2C%20focus%20on%20the%20other%20cells%20and%20ask%20%22How%20do%20I%20determine%20the%20value%20of%20this%20cell%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2557895%22%20slang%3D%22en-US%22%3ERe%3A%20Mutiple%20formulas%20in%201%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2557895%22%20slang%3D%22en-US%22%3EHi%20there%2C%20thanks%20so%20much%20for%20the%20response.%20Here%20is%20a%20copy%20of%20what%20i%20am%20trying%20to%20do.%3CBR%20%2F%3EThis%20table%20is%20for%20a%20golf%20game%20and%20basically%20on%20hole%201%20if%20par%20is%20a%204%20and%20Greg%20scores%20a%206%20he%20should%20get%200%20points%2C%20if%20he%20scores%20a%205%20he%20should%20get%201%20point%20and%20he%20scores%20a%204%20then%202%20points%20and%20if%20he%20scores%20a%203%20then%20gets%203%20points.%20I%20am%20trying%20to%20input%20the%20mutiple%20what%20if%20formula%20into%20where%20the%20Points%20total%20(1)%20is%20and%20retreive%20the%20data%20from%20where%20Greg%20inputs%20his%20score%20(5)%3CBR%20%2F%3EHole%201%20Hole%202%20Hole%203%20.........etc%3CBR%20%2F%3EPar%204%205%203%3CBR%20%2F%3EGreg%205%204%204%3CBR%20%2F%3EPoints%201%3CBR%20%2F%3ENot%20sure%20if%20this%20is%20possible%20but%20any%20further%20help%20would%20be%20very%20much%20appreciated.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2558123%22%20slang%3D%22en-US%22%3ERe%3A%20Mutiple%20formulas%20in%201%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2558123%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1104591%22%20target%3D%22_blank%22%3E%40Budwizer_10%3C%2FA%3E%26nbsp%3BNo%20problem.%20See%20attached%20workbook%20for%20a%20working%20example%20based%20on%20your%20description.%20But%20I%20suspect%20that%20your%20next%20question%20will%20be%20to%20include%20course%20rating%2C%20multiple%20players%2C%20stroke%20index%2C%20handicap%20and%20playing%20handicap.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20attached%20file%20you'll%20find%20two%20solution.%20One%20with%20new%20Excel%20functions%20and%20one%20with%20an%20%22old-style%22%20approach.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2558771%22%20slang%3D%22en-US%22%3ERe%3A%20Mutiple%20formulas%20in%201%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2558771%22%20slang%3D%22en-US%22%3ERiny%2Fvan%2FEekelen%2C%20thank%20you%20so%20much%20this%20is%20what%20i%20was%20looking%20for%20and%20it%20now%20makes%20sense%2C%20what%20you%20are%20saying.%20Excel%20is%20unable%20to%20create%20a%20mutiple%20formula%20in%20one%20cell%20so%20you%20have%20to%20create%20a%20data%20table%20to%20draw%20from%20for%20all%20the%20what%20ifs.%20Again%20thank%20you%20so%20much.%20Greg%3C%2FLINGO-BODY%3E
Occasional 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 @Peter Bartholomew 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 (Occasional 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.