Help adding more criteria to my IF function

Excelstudent01

New Member
Joined
Mar 17, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi,
Would it be possible to add another statement to the formula in G2 that would return a blank cell if Code (cell A2) does not equal 56 (if A2 <> 56 then " ") in addition to the criteria I already have in G2?
Thank you for your help!!
 

Attachments

  • Screenshot 2024-03-17 004503.png
    Screenshot 2024-03-17 004503.png
    16.8 KB · Views: 24

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Welcome to the MrExcel board!

Is this what you mean?
=IF(A2<>56,"",
1710660009257.png
)
 
Upvote 0
Upvote 0
Thank you for your response. Yes, that looks like what I want but I am unable to get the formula to work, I'm missing something. IF(A2<>56,"",(AND(B2<>B1,E3<>E2),1,IF(AND(B2<>B1,E3=E2),0,IF(OR(E2<>E3,B3<>B2),1,0))))
I was able to write the formula so Excel would accept it but I am not getting the results I want. I am getting 0's for all rows. Essentially what I am trying to do it roll up stays that are less than 7 days apart into 1 stay, by each ID. I only want to do this for Code type =56. I was attempting to have column G return a 1 for each duration that was 7 days after the previous duration, for each ID (but only for Code=56). It is hard to explain but if you are able to understand what I am trying to do and have an easier way of doing it, please let me know!
Thanks!
 

Attachments

  • Capture.PNG
    Capture.PNG
    35.9 KB · Views: 11
Upvote 0
Very difficult to test without sample data and we cannot copy from an image so could wee have the sample data (and the expected results filled in manually) with XL2BB and explain again in relation to that sample data exactly what you are trying to achieve?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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