Nested IF Formula

Freeman2022

New Member
Joined
Nov 3, 2021
Messages
44
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm having trouble with a nested formula, PLEASE HELP

If Type is Edit and Video is Y then Points=3
If Type is Edit and Video is N then Points=1
If Type is Published and Video is Y then Points=4
If Type is Published and Video is N then Points=2

See attached File
 

Attachments

  • Nest If Function Excel.PNG
    Nest If Function Excel.PNG
    4 KB · Views: 10

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
just make a function in a module then the usage is (or similar):
=getPoints(C1,C2,C3,C4)

Code:
Sub getPoints(ByVal pvEdit, ByVal pvPublish As Boolean, ByVal pvVideo)
Select Case True
   Case pvEdit = "Edit" And pvVideo = "Y"
     getPoints = 3
   Case pvEdit = "Edit" And pvVideo = "N"
     getPoints = 1
   Case pvPublish = "Published" And pvVideo = "Y"
     getPoints = 4
   Case pvPublish = "Published" And pvVideo = "N"
     getPoints = 2
End Select
End Sub
 
Upvote 0
Good afternoon,

An IFS formula wrapped in an IFERROR formula can do the trick:

Excel Formula:
=IFERROR(IFS(AND(A2="Y",B2="Edit"),3,AND(A2="N",B2="Edit"),1,AND(A2="Y",B2="Published"),4,AND(A2="N",B2="Published"),2),0)

1658508618228.png
 
Upvote 0
Solution
Hi & welcome to MrExcel.
Another option
Excel Formula:
=IF(B2="edit",1,2)+IF(A2="Y",2,0)

@orienip The OP has xl2016 & so doesn't have the IFS function.
 
Upvote 0
Thanks everyone...All of the solutions worked. Is there a way to mark all as solutions, I'm pretty new to this, but wanted to ensure everyone got credit. Thanks again
 
Upvote 0
In that case I would suggest updating your profile. ;)
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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