Help with an Excel formula, please !

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Help with an Excel formula, please !

Post by Olimpiu »

Hello to everyone !

I have a project and the only way to do it is in Excel, on my computer.

My problem is that I have to add a value to one parameter depending of the value of the parameter.

Example :

I have three parameters ( cells). A, B and C

Depending of the ratio between A,B and C, to each one I have to add a value.

If A>B, A>C, B>C, then add value "W" to A, add value "Y" to B, add value "Z" to C

If A>B, A>C, B<C then add value "W" to A, add value "T" to B, add value "S" to C

So on...

For each situation, I have to add a specific value to A, B and C

There are 13 posibble ratios between A,B and C :

A>B, A>C, B>C

A>B, A>C, B<C

A<B, A>C, B>C

A>B, A<C, B<C

A<B, A<C, B>C

A<B, A<C, B<C

A>B, A=C, B<C

A=B, A>C, B>C

A<B, A<C, B=C

A>B, A>C, B=C

A<B, A=C, B>C

A=B, A<C, B<C

A=B, A=C, B=C

A plastic example is in the attached picture, where :
- green is the cell wit the highest value
- orange is the cell with a middle value
- red is the cell with the smallest value

The number of values that I have to add to A, B and C are 24 ( in total)

It is possible to do this in Excel?

Thank you for your time !
You do not have the required permissions to view the files attached to this post.

User avatar
StuartR
Administrator
Posts: 12618
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Help with an Excel formula, please !

Post by StuartR »

Do you want to add the values to the existing cells in Excel, or do you want to add these values and display the results in a separate area of the worksheet?
StuartR


Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

I need that the A, B and C cels ( with the added values) to be displeyed in a separate area ( to see both )
I attached a new example ( to express myself more correct)
For each case, a specific value is added.
in the bottom of the picture is 1, 3, 5 and ?, ?, ?
I need that the excel to find witch one ( from 1, 3 and 5) is highest, smallest, medium and after that to add the values according to the rulle.
For this case ( 1,5,3) the excel must add the values : "2,64" " 5.3 " "-7.9" :
2.64 to be added to cell with value 1
5.3 to be added to cell with value 5
-7.9 to be added to cel with value 3





Thank you !
You do not have the required permissions to view the files attached to this post.

User avatar
StuartR
Administrator
Posts: 12618
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Help with an Excel formula, please !

Post by StuartR »

That's very clear. I could probably come up with a ridiculously long and over-complex formula to do this, but I shall wait for a while because someone cleverer than me will probably have a sensible suggestion.
StuartR


Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

Thank you very much !

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

Maybe a code than I can aply to an entire sheet ( macros). Not necessarily a formula...

User avatar
HansV
Administrator
Posts: 78577
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Help with an Excel formula, please !

Post by HansV »

Welcome to Eileen's Lounge!
Could you attach a workbook with the sheet displayed in your last screenshot? That way, we don't have to type it in from scratch.
Thanks in advance.
Best wishes,
Hans

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

I attached an Excel file.
Explanations :
Columns C,D,E are the variable cels and the values of their cels are different from row to row.
Columns H,I,J are fixed values that must be added to C,D,E.
Columns M,N,O are the result that I need. I put the formula manually
The problem appears when I want theese calculation to be automatic, because the excel need to know, the differences between C4, D4 and E4.
From theese 3 cels, we can have 13 possibble cases ( the colors explains the velocity of the cels, compared between them)
And the excel must know wich one of the 13 possibble cases is the case of a new entered values of the C,D,E cels.
When it knows that, it can aplly the rule from H,I,J.
I a sorry if sometime I go in circles with the explanations, but my translation cames slow in my mind...
Thank you !
You do not have the required permissions to view the files attached to this post.

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

If there are only 2 cels, the IF function can be aplied easily. But with 3 parameters...
I tried something like IF(cell1>cell2<cell3,value1,value2), but the result are wrong
Also, I tried something like IF(cell1>cell2&cell1>cell3,value1,value2), but, also, it gives wrong answers.

User avatar
HansV
Administrator
Posts: 78577
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Help with an Excel formula, please !

Post by HansV »

Thanks! I'll take a look.
Best wishes,
Hans

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

If there is a formula to do this and you can find it, it will be the perfect result.
If there is not a formua for this task, also, a source code for an entire sheet will be great.
I know I asked a rare and stupid thing, but this will solve a lot of my problems.

User avatar
SpeakEasy
4StarLounger
Posts: 563
Joined: 27 Jun 2021, 10:46

Re: Help with an Excel formula, please !

Post by SpeakEasy »

How about:
ranking.xlsx
You do not have the required permissions to view the files attached to this post.

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

I downloaded it. I am afraid that i don't understand.
For example, I have a new entry row with parameters 20 14 15
For theese, where i can find the new values ( cell + adding fix value ) ?
FIle attached.
Thanks !
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78577
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Help with an Excel formula, please !

Post by HansV »

How about this?
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
SpeakEasy
4StarLounger
Posts: 563
Joined: 27 Jun 2021, 10:46

Re: Help with an Excel formula, please !

Post by SpeakEasy »

For this example, just enter it in the cells that currently show 1 5 3, i.e
ranking_1.xlsx
You do not have the required permissions to view the files attached to this post.

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

Somethins is not good. When I type new values i can not see in any cel, the new value wit the corespondent added value. What i am doing wrong ?
Thanks !

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

I don't know how to responde for each post

User avatar
SpeakEasy
4StarLounger
Posts: 563
Joined: 27 Jun 2021, 10:46

Re: Help with an Excel formula, please !

Post by SpeakEasy »

The example doesn't do the adding. It shows the values that need to be added. HansV's suggestion does the same thing.

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

In the CDE columns I insert the new numbers
In the HIJ columns must be displayed the results ( H15 = C15 + fix value from the PQR table)
In the PQR table are the fix ( not changeble) values that must be added to CDE.
I attached the file.
You do not have the required permissions to view the files attached to this post.

Olimpiu
NewLounger
Posts: 17
Joined: 11 Apr 2023, 08:36

Re: Help with an Excel formula, please !

Post by Olimpiu »

I mean, the excel must display in H5, the sum between C5 and one of the cels P18-P33.
The excel must know the rankings of C,D,E so it knows what cell from P column to add to the C column