Perform calculation if certain number in cell; otherwise, enter value from different cell

mcdcpa

New Member
Joined
Aug 5, 2022
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi, all. I think what I need is pretty straightforward, but I'm nonetheless struggling to achieve it. I've got three columns of data. Column A shows age in days, Column B shows a status code (1, 2, 3, 4, or 5), Column C shows days in status, and Column D will show the results of the calculation. I need a formula that will subtract Column C from Column A if Column B = 5; otherwise, the value in Column C will be returned. I'm guessing an IF statement will accomplish this, but I'm having trouble coding the piece that would return the value in Column C if the status code is 1, 2, 3, or 4.

Thanks in advance.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
How about

Excel Formula:
=IF(B2=5,A2-C2,C2)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,944
Messages
6,122,387
Members
449,080
Latest member
Armadillos

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