Question using IF function

executionerhk

New Member
Joined
Oct 10, 2010
Messages
22
It might be stupid.
I am writing an IF function.

=IF(A1="XXX", "ABC DEF", IF(A1="YYY", "HIJ LMN", IF(A1="ZZZ", "OPQ RST", "N/A")))

What I want is if it is XXX
It will display as follow
ABC
DEF
after ABC I want it to be a new line and the DEF.

same as for
HIJ
LMB

OPQ
RST

Can anyone tell me how can I achieve a new line in a cell when I am using IF function?

If this possible.

Thanks,
Steve
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi,

Try this formula instead:
Code:
=IF(A1="XXX", "ABC"&CHAR(10)&"DEF", 
    IF(A1="YYY", "HIJ"&CHAR(10)&"LMN", 
    IF(A1="ZZZ", "OPQ"&CHAR(10)&"RST", "N/A")))
And format the cell alignment to wrap text.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top