Combine two working formulas

fingermouse

Board Regular
Joined
Dec 13, 2013
Messages
117
Hi, hopefully someone can help with my problem as per the title:

I have 2 working formulas I want to combine with a bit of adjusting:

This formula works (Formula 1)

=IF(AND('Data Area'!BH2="N/A",'Data Area'!AU2="DS"),"Pass","Fail - POMI cannot be N/A")



So does this one: (Formula 2)

=IF(OR(ISBLANK('Data Area'!BH2),ISBLANK('Data Area'!CM2)),"Fail-POPT or POPI cannot be blank",IF('Data Area'!AR2="EWI_Parkhomes",IF(VALUE('Data Area'!CM2)<>VALUE('Data Area'!BH2),"Fail - POMI and POPT for park homes insulation measures must always be equal","Pass"),IF('Data Area'!BH2="N/A","Fail - POMI cannot be N/A",IF(VALUE('Data Area'!CM2)>VALUE('Data Area'!BH2),"Fail - POPT cannot be greater than POMI","Pass"))))

I want to adapt it slightly and replace the red part in formula 2 with formula 1. Like this:


=IF(OR(ISBLANK('Data Area'!BH2),ISBLANK('Data Area'!CM2)),"Fail-POPT or POPI cannot be blank",IF('Data Area'!AR2="EWI_Parkhomes",IF(VALUE('Data Area'!CM2)<>VALUE('Data Area'!BH2),"Fail - POMI and POPT for park homes insulation measures must always be equal","Pass"),IF(AND('Data Area'!BH2="N/A",'Data Area'!AU2="DS"),"Pass","Fail - POMI cannot be N/A",IF(VALUE('Data Area'!CM2)>VALUE('Data Area'!BH2),"Fail - POPT cannot be greater than POMI","Pass"))))

Error message says I have too many arguments. Can someone please provide the correct formula? Many thanks in advance, Cal
 
Re: need help to combine two working formulas

Looks like you are trying to get "pass" returned before checking all the conditions. the part you have in red should be coded to check for failure and return the fail message then the false argument should be your last if statement. Untested but something like this maybe what you want

Code:
=IF(OR(ISBLANK('Data Area'!BH2),ISBLANK('Data Area'!CM2)),"Fail-POPT or POPI cannot be blank",IF('Data Area'!AR2="EWI_Parkhomes",IF(VALUE('Data Area'!CM2)<>VALUE('Data Area'!BH2),"Fail - POMI and POPT for park homes insulation measures must always be equal","Pass"),IF(AND('Data Area'!BH2<>"N/A",'Data Area'!AU2<>"DS"),"Fail - POMI cannot be N/A",IF(VALUE('Data Area'!CM2)>VALUE('Data Area'!BH2),"Fail - POPT cannot be greater than POMI","Pass"))))


Brilliant Scott, ive tested and it works!!! many thanks for all your help and patience, its much appreciated.
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,958
Messages
6,175,633
Members
452,661
Latest member
Nonhle

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