Compare two cells and determine one of three actions to return a value

Novice Excel User

New Member
Joined
May 16, 2024
Messages
14
Office Version
  1. 365
Platform
  1. Windows
What I need is a formula to compare the frequency (hourly/weekly) in D8 and D9 and perform one of the following:
  • If D8 is Hourly and D9 is weekly then multiply C15 by E8
  • If D8 is weekly and D8 is hourly then divide C15 by E8
  • If D8 and D9 are the same (both are either hourly or weekly) then return the value in C15 as is
Essentially I need the salary in C15 to reflect the appropriate frequency in order to calculate what the new salary at the correct frequency, either hourly or weekly.

Here's a couple formulas I have tried, but don't seem to work fully:
=IF(AND(G8="hourly", G9="weekly"), F15*H8, IF(AND(G8="weekly", G9="hourly"), F15/H8, F15))
=IFS(D8=D9, C15, AND(D8="Hourly", D9="Weekly"), C15*E8, AND(D8="Weekly", D9="Hourly"), C15/E8)
 
This one seems to work, THANK YOU!!!

The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,939
Messages
6,175,531
Members
452,651
Latest member
wordsearch

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