If Formula

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
786
Office Version
  1. 365
I have a spreadsheet with 3 columns

1=Booked, 2-Tentative, 3-Cancelled


then a i have a date field in column E and room nigts column F.


for example if it is booked type an x and booked column then type date and number of nights in column E and F.

What I want is an if formula in cell 8 to add all room nights in comunt in column F if the there's an x booked column.

How would I do that?

I type this but gave an error value?

Code:
I have a spreadsheet with 3 columns

1=Booked, 2-Tentative, 3-Cancelled


then a i have a date field in column E and room nigts column F.


for example if it is booked type an x and booked column then type date and number of nights in column E and F.

What I want is an if formula in cell 8 to add all room nights in comunt in column F if the there's an x booked column.

How would I do that?

I type this but gave an error value?

[CODE]=if(ColumnBooked=X,Sum(ColumnF),"")
thank you
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have a spreadsheet with 3 columns

1=Booked, 2-Tentative, 3-Cancelled


then a i have a date field in column E and room nigts column F.


for example if it is booked type an x and booked column then type date and number of nights in column E and F.

What I want is an if formula in cell 8 to add all room nights in comunt in column F if the there's an x booked column.

How would I do that?

I type this but gave an error value?

Code:
I have a spreadsheet with 3 columns
 
1=Booked, 2-Tentative, 3-Cancelled
 
 
then a i have a date field in column E and room nigts column F.
 
 
for example if it is booked type an x and booked column then type date and number of nights in column E and F.
 
What I want is an if formula in cell 8 to add all room nights in comunt in column F if the there's an x booked column.
 
How would I do that?
 
I type this but gave an error value?
 
[CODE]=if(ColumnBooked=X,Sum(ColumnF),"")
thank you
Try something like this...

=SUMIF(A2:A10,"X",F2:F10)
 
Upvote 0
Thank you very much worked perfectly.
another question,
I have this formula to get avaerage rate but because the filed refering to is blank I get the #Div0! error, how to get rid of this?

formula:
Code:
=SUMIF(H22:H41,"X",N22:N41)/L14)
thank you
 
Upvote 0
Thank you very much worked perfectly.
another question,
I have this formula to get avaerage rate but because the filed refering to is blank I get the #Div0! error, how to get rid of this?

formula:
Code:
=SUMIF(H22:H41,"X",N22:N41)/L14)
thank you
Try this...

=IF(L14="","",SUMIF(H22:H41,"X",N22:N41)/L14)
 
Upvote 0
Thank you

but I still getting same error #Div0!

thanks again
Hmmm...

What's in L14?

What version of Excel are you using?

This formula will work in EVERY version of Excel:

=IF(ISERROR(SUMIF(H22:H41,"X",N22:N41)/L14),"",SUMIF(H22:H41,"X",N22:N41)/L14)

If you're using Excel 2007 or later:

=IFERROR(SUMIF(H22:H41,"X",N22:N41)/L14,"")
 
Upvote 0
I am an excel amateur. This post on "If" excel formulas really helped me grasp the basics. I have always "winged" it when using excel, and now with my new job responsibilities I cannot get away with it as easily. My job now requires me to create a long running sheet tracking sales goals with actual sales which matches up to the budget. It will ultimately show a running profit less expenses.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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