Compare cells and print content

mikmob

New Member
Joined
May 25, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Can anyone help me with a Formula or VBA code to get following result:

If cell A end cell C are equal then print content of A.
If cell A end cell C are NOT equal then print content of A/C.
(...and by print I mean write in another cell.)


Thanks!
 
Last edited by a moderator:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Welcome to the Board!

What exactly is in the cell?
Are they numbers (so you may want to do division) or text?

If numeric, then for row 1, the formula would look like this:
Excel Formula:
=IF(A1=C1,A1,A1/C1)

If text, then I can only guess you may want something like this:
Excel Formula:
=IF(A1=C1,A1,A1 & "/" & C1)
 
Upvote 0
Solution
Doesn't work yet.

The cells contain a formula for moths.

Cell (C4) - =TEXT(A4;"MMM")
Cell (C10)- =TEXT(A10;"MMM")

C4 shows Dec
C10 shows Jan

What I want is for cell D8 to show Dec if both are December and Dec/Jan if they differ.
 
Upvote 0
Welcome to the Board!

What exactly is in the cell?
Are they numbers (so you may want to do division) or text?

If numeric, then for row 1, the formula would look like this:
Excel Formula:
=IF(A1=C1,A1,A1/C1)

If text, then I can only guess you may want something like this:
Excel Formula:
=IF(A1=C1,A1,A1 & "/" & C1)
Works! missed a ,

Thanks!
 
Upvote 0

Forum statistics

Threads
1,213,483
Messages
6,113,919
Members
448,533
Latest member
thietbibeboiwasaco

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