if statement query

casa

New Member
Joined
Mar 17, 2009
Messages
2
Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
Wondered if this might be a simple question and I'm just not thinking laterally enough (still quite amateur user of excel):<o:p></o:p>
<o:p> </o:p>
I would like to do a calculation using the following fields-<o:p></o:p>
<o:p> </o:p>
Date referral Booked date, seen date, if seen, still waiting, census date.<o:p></o:p>
Received,<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
I’m sure I could make it neater but anyway…<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
In the ‘seen date’ column there may not always be a date. – it could be a date or it could be blank.<o:p></o:p>
<o:p> </o:p>
What I would like to do is a calculation though an if statement to say <o:p></o:p>
  • if there’s a date in the ‘seen date’ field then calculate the difference between the ‘date referral received’ and the ‘seen date’<o:p></o:p>
  • if there is no date in the ‘seen date’ field then populate the ‘still waiting’ field with the difference between the date referral received and the census date.<o:p></o:p>
<o:p> I need to graph the results afterwards as well but need to get the functionality of the data right first.</o:p>
Hope this makes sense,<o:p></o:p>
Thank you in advance,<o:p></o:p>
Casa<o:p></o:p>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
In still waiting column type.......

If(seen date="",date referred received-census date,date seen-referal received date)

Where I've put your column headings just type inthe cell address and copy it down.


I have changed the formula assuming that the seen date is after the referal. If the census date is usually after the referal you'll need to change that one as well.
 
Upvote 0
Assuming your headers start in A1 then your formulas start in row 2


if there’s a date in the ‘seen date’ field then calculate the difference between the ‘date referral received’ and the ‘seen date’<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>

=IF(C2="",""C2-A2)

if there is no date in the ‘seen date’ field then populate the ‘still waiting’ field with the difference between the date referral received and the census date.<o:p></o:p>

=IF(C2="",""G2-A2)
 
Upvote 0
I was thinking it around the wrong way, much obliged to you both BGY23 and excelR8R,

I don't really need the second column at the end if not seen now which makes much more sense,

Thanks:)

Casa
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

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