Update formula to check other conditions

dd8

New Member
Joined
Feb 21, 2024
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I have inherited a spreadsheet from someone who has left the company.

They created a formula which is great. I would like to edit and obtain more information.

Column H contains data. The values are:
date
if date does not exist than enter N/A
Other status data entered is
INACTIVE
OFFLINE


Column I, J & K are hidden columns, which I have unhidden and contain formulas. The next column appears to tidy up the previous column.

ExcelColumns.png



column I formula
=[@[DUE DATE]]-TODAY()

Column J formula
=IF([@[DAYS TIL DUE]]<0,"OVERDUE",IF([@[DAYS TIL DUE]]>90,"Not Due",IF([@[DAYS TIL DUE]]>30,"Due Next 90 Days","Due This Month")))

Colum K formula
=IFERROR(J4,"Not Due")


I need to update column J formula to check the following conditions ..
if date value is N/A, then perform action 1
if date value INACVTIVE, then perform action 2
if date value OFFLINE, then perform action 3

How can this be done? or is the formula going to get very complex?


thanks in advance
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
what are the action 1,2,3 you want to do - Or is it just add those words "action 1" , "action 2" & "action 3"
which i have added below

Also , the IFERROR could be used on the J formula and NOT recreate a new column K - But as hidden - I suspect column K is used elsewhere

=IF([@[DAYS TIL DUE]]<0,"OVERDUE",IF([@[DAYS TIL DUE]]>90,"Not Due",IF([@[DAYS TIL DUE]]>30,"Due Next 90 Days","Due This Month")))
becomes
=IFERROR(IF([@[DAYS TIL DUE]]<0,"OVERDUE",IF([@[DAYS TIL DUE]]>90,"Not Due",IF([@[DAYS TIL DUE]]>30,"Due Next 90 Days","Due This Month"))),"NOT DUE")

But I suspect a lot of other things are going on based on column K.......

however you want to Add different things to column J - which will impact column K, and feed through those actions to K

Which will mean column K will also change , and NOT show , "NOT DUE" as it does now for any value errors , depending on what actions 1,2,3 are

you would just add some more nested IF's

=IF ( H2 = "N/A" , "Action 1", IF ( H2 = "INACTIVE" , "Action 2", IF ( H2 = "OFFLINE" , "Action 3", IF([@[DAYS TIL DUE]]<0,"OVERDUE",IF([@[DAYS TIL DUE]]>90,"Not Due",IF([@[DAYS TIL DUE]]>30,"Due Next 90 Days","Due This Month"))))))

H2 could be changed to the table Name , as you have shown - I rarely use table names and not sure about the [@[name]]

=IF ( [@[DUE DATE]] = "N/A" , "Action 1", IF ( [@[DUE DATE]] = "INACTIVE" , "Action 2", IF ( [@[DUE DATE]] = "OFFLINE" , "Action 3", IF([@[DAYS TIL DUE]]<0,"OVERDUE",IF([@[DAYS TIL DUE]]>90,"Not Due",IF([@[DAYS TIL DUE]]>30,"Due Next 90 Days","Due This Month"))))))

make sure you make a copy of the file and test that - so you dont muckup the original version that someone else made , and you can go back to a working file

also do you know all the other columns that use the results of H, I, J or K columns , as changes here may have implications on a lot of other parts of the spreadsheet , column I , J & K columns are hidden then can only assume the rest of the spreadsheet is using them , most probably column K, as you say - as that also has the IFERROR in which will now give a different result

When you say
The next column appears to tidy up the previous column.
what do you mean , that Column K tidies up Column J

ALSO
Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
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