# Excel - IF Function Problem - Expert Solution

Question description:
This user has given permission to use the problem statement for this blog.

I have two numbers. 80 in A5 and a variable number in A6. I want excel to calculate if A6 > A5, then print the score from A6 in A7. If A6 < A5, then print A5's number. How do I do so?
Solved by K. E. in 12 mins
This is the chat thread from the real Excelchat help session. It contains no private user information.
Excelchat Expert 23/04/2018 - 08:48
Hi
User 23/04/2018 - 08:48
Hi
Excelchat Expert 23/04/2018 - 08:48
Welcome to Got It Pro
User 23/04/2018 - 08:48
thanks
Excelchat Expert 23/04/2018 - 08:49
I am working on the requirement. It can be solved using if function.
Excelchat Expert 23/04/2018 - 08:49
=if(A6>A5,A6,A5)
Excelchat Expert 23/04/2018 - 08:50
I have considered if function and added true and false condition.
User 23/04/2018 - 08:50
why did you put A6, A5 after the A6>A5? What purpose does that serve? (I'm a noob at this)
User 23/04/2018 - 08:50
is it because its true, false? Is it written like that?
Excelchat Expert 23/04/2018 - 08:50
=if(condition, True result, False result)
Excelchat Expert 23/04/2018 - 08:51
So, when A6>A5, true value is A6
Excelchat Expert 23/04/2018 - 08:51
Else, It is A5.
User 23/04/2018 - 08:51
ohhh i see.
Excelchat Expert 23/04/2018 - 08:51
Hope, you got the idea.
User 23/04/2018 - 08:51
and if i wanted it to return text
Excelchat Expert 23/04/2018 - 08:51
What text?
User 23/04/2018 - 08:51
will it return text? or do i have to put it in a specific format?
User 23/04/2018 - 08:52
i.e. like say i want it to say "Congrats you beat the A5 score" or something
Excelchat Expert 23/04/2018 - 08:52
It return the number in the cells.
Excelchat Expert 23/04/2018 - 08:52
Ok .That is possible.
Excelchat Expert 23/04/2018 - 08:52
I will update the formula.
Excelchat Expert 23/04/2018 - 08:53
=if(A6>A5,"Congrats you beat the "&A6&" score","Congrats you beat the "&A5&" score")
Excelchat Expert 23/04/2018 - 08:53
it is called concatenation of string.
User 23/04/2018 - 08:56
why did you put & & in front and behind the A6?
Excelchat Expert 23/04/2018 - 08:56
It is joining of the string.
User 23/04/2018 - 09:00
eh its okay. thank you for your help

This is the output file from the real Excelchat help session:
This is an example of the expert help you can get. It contains no private user information.

Get instant expert help with Excel and Google Sheets

#### Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Your privacy is guaranteed. Your session will not be used for blog unless you give us persmission.