Help with IF statements

Copper Contributor

Hi there, I am an excel newcomer and am currently trying to build a spreadsheet to track sales from my ebay flipping business.  I am trying to have a column in the spreadsheet that displays the total days a listing was active for.  This can easily be done if you have both the date listed and date sold by subtracting them from each other, but what I would also like the spreadsheet to do is calculate how long a listing has been active for when the date sold column is empty, by subtracting the date listed from the current date.  I have tried using if statements with no success, possibly because it doesn't allow you to apply formulae if the conditions are met?  What I would like to know is if what I am trying to do is possible and if so how to do it  Any help is much appreciated.  Thanks in advanceCapture.PNG

3 Replies

@evanh3103 

=IF(E10="",TODAY(),E10)-D10

@Hans Vogelaar Thanks so much for helping me solve this, I'd like to ask another question if it isn't too much trouble for you.  I have another column that records the profit from each sale and I would like to have a cell at the bottom of it that displays the total profit.  Is there a way to automatically sum the column and display it in said cell without having to change the whole formula every time a new row is added in the spreadsheet?

@evanh3103 

There are several ways you can do that:

 

1) Let's say that your data are in M2:M50.

Leave row 51 empty.

In M52, enter the formula = SUM(M2:M51)

When you need to add a new row, insert it in row 51. Excel will automatically update the formula to =SUM(M2:M52)

 

2) Convert your data to a table (Insert tab of the ribbon > Table).

You can add a Total row to the table and specify Sum as summary function.

S2205.png