Need help with IF formula

wislndixie

New Member
Joined
Feb 13, 2004
Messages
23
I've created a very simple spread sheet but I need help creating a IF formula that will calculate:
Cell J2 is a "y" or "n" value.
I want my formula to SUM f2:h2 if the value in J2 is y
I want my formula to SUM f2:g2 if the value in J2 is n

I tried this:
=if(J2=y,sum(f2:h2),sum(f2:g2))
I just get a zero in the cell that I type the formula.
I am using Excel 97.

thanks,
Wisln
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Oh man, you guys are geniuses..thanks for the help. It worked perfect. I'm sure I'll be back with more questions..
Wisln
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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